Hi everybody, I'm a newby of Eclipse and I'm trying to solve some simple exercizes using the eplex solver in combination with repair solver. My problem is as follow: (1) Scheduule Repair Task Name Preferred Start Time Duration a 1 2 b 3 2 c 4 5 d 6 2 e 7 6 f 9 2 g 10 2 These tasks must all be executed on one machine – they cannot overlap in time. (a) Use a linear solver model to minimise the sum of the differences between the task start times and their preferred start times. Ignore the resource constraints, so the first solution will simply choose the preferred times. (b) Use the repair solver to detect overlapping tasks in the solution found by the linear solver, and add a new linear constraint which prevents them from overlapping. Post an alternative constraint on backtracking. Specify a heuristic to choose which conflict to fix next. (c) Combine these solvers to solve the problem. I had no problem with point (a) but I have no idea how to combine the eplex with repair solver. In the tutorial there is an example for combining ic and repair solver. But no example for "probing" with eplex solver. I post a piece of code I made until now: %%%%%%%%%%%%%%%%%%%%% % Search solution by tentative assignement % %%%%%%%%%%%%%%%%%%%%% repair_conflicts(StartTimes) :- conflict_constraints(cs,List), ( List = [] -> set_to_tent(StartTimes) ; %Choose next constraint to fix according to an heuristic chooseConstraintMin(List,Constraint), term_variables(Constraint,[S1,B,S2]), % I can not retrieve the duration I have to use some kind of structure. % This predicate bind the value to S1 and S2 according to some criteria assign_value(S1,S2,D2,D1), % Maybe do I have to post constraint here with call(constraint) predicate? repair_conflicts(StartTimes) ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Defines the set of constraints preventing the tasks overlapping % % and construct the repair set % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% no_overlap(StartTimes,Duration,BooleanVar) :- length(StartTimes,L), (for(I,1,L), foreach(S1,StartTimes),foreach(D1,Duration), param(StartTimes), param(L), param(Duration),param(BooleanVar) do (for(J,1,L),foreach(S2,StartTimes),foreach(D2,Duration), param(S1), param(D1), param(I), param(BooleanVar) do (I=\=J -> B1 is BooleanVar[1,I,J], B2 is BooleanVar[2,I,J], S1+100 - B1*100 $>= S2+D2 r_conflict cs, S2+100 - B2*100 $>= S1+D1 r_conflict cs, B1+B2 $>= 1 r_conflict cs;true) ) ). My main problem is in the procedure repair_conflicts where I have to enforce the constraint to eplex and use the results in some way. Thank you very much to anyone that can help me. Simone Riccucci -- Simone Riccucci - PhD Student in Computer Science Dep. of Computer Science - University of Bologna via Mura Anteo Zamboni, 7 - 40127 Bologna (Italy)Received on Mon Oct 10 15:27:24 2005
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:39 PM GMT GMT