/********************************************************/ /* project ? D o m F L I P + + */ /********************************************************/ /* by whom ? Witold Hendrysiak */ /* with whom ? Wolfgang Slany */ /* when ? 1994/1995 */ /* what ? domain design */ /* why ? Diplomarbeit */ /* how ? C++ */ /********************************************************/ Moduls: ============================================================================== (flip.h, bool.h, cflplist.h, errort.h) | | ____________________________________________ | | | domerr.h | common.h / \ | / / _____domlist.h__________________ errtxtdm.cpp | | \___domlist.cpp | | order.h | |\___order.cpp | | domain1.h | |\___domain1.cpp | | cviolat.h | |\___cviolat.cpp | | cviollst.h | |\___cviollst.cpp | | repair.h | |\___repair.cpp | | replst.h | |\_replst.cpp | | domagg.h | |\___domagg.cpp | | domaglst.h | |\___domaglst.cpp | \ | \___repstepd.h domlib.h | |\___domlib.cpp | | hash.h | |\___hash.cpp | | tabu.h | |\___tabu.cpp | | domflip.h | \___domflip.cpp Objects: ============================================================================== DomFLIP++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ConstrViolation Repair Aggregat Domain Hash Tabu DomFlip GenList | | |___ListOfConstr | | |___ListOfInt | | |___ListOfCviol | | |___ListOfRepairs | | |___ListOfAgg GenSled | | |___SledForConstr | | |___SledForInt | | |___SledForCviol | | |___SledForRepairs | | |___SledForAgg Domain1: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Order GenList | |___ListOfConstr | | |___ListOfInt | | |___ListOfEntr GenSled | | |___SledForInt | | |___SledForEntrr Domain2: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Not implemented yet. Interface to OptiFLIP ++ ============================================================================== Optimizing algorithms operate on objects of the Domain class. They have to be defined between the declaration of the Domain class and DomFlip class. Attributs of Domain: char name[LENGTH_OF_NAMES]; float evaluation; // evaluation value optmethode optmet; // selected optimize method ind adv_idx; // index for next repair int rep_step; // next repair step SledForAgg aggs; // sled for aggregats in domain ListOfConstr dom_constr; // domain constraints ListOfCviol c_violl; // list with all constraints ListOfRepairs repairl; // constr violation -> repair step Important methods of Domain: void copy(Domain & const source); void set_opt_meth( int); float evaluate_plan(void); bool get_advice(int, int); Every call of evaluate_plan() evaluates the current Aggregate object and creates a new list of constraint violations (c_violl). The method get_advice(int i, int h) sets the attributes of a Domain object: adv_idx (agg-aggregat, pla-place, num- number of items) and rep_step (repair step); for h-th violated constraint from c_violl and i-th repair step. If you need to define a new repair step you have to edit: repstepd.h to define the new repair step common.h to set a new integer value for the new repair step. If you want to include new optimizing algorithms you have to: extend the definition of optmethod in domlib.h ( current definition: enum optmethod {TabuAlg=0,GeneticAlg=1}; ). define new objects and methods you need to act on Domain and include those files. extend the method optimize(), in order to be able to call the new optimizing algorithm. Interface to DynaFLIP ++ ============================================================================== DynaFLIP++ is an interface to ConFLIP++ and FLIP++. The functionality of the Domain method evaluate_plan() is located in DynaFLIP++. Every call of evaluate_plan() sets: The Domain attribut c_violl which includes a list of names of evaluated constraints and index information (aggregate and place) The current Aggregate attribute agg_evaluation. The constraints are listed in an increasing order of satisfaction, i.e. the constraint with biggest violation is placed on first position. Best evaluated constraints are on the end of this list. Definition of a new Domain ============================================================================== 1) Define a class for the scheduled to be object. It consists of descriptive attributes like name or number and attributes you will need for evaluation. The former type attributes can be defined as usual. The latter type attributes have to by defined using ConFLIP++ as constraints and added to the object in form of a list. 2) Now you can generate file including the definition of this new class, and new file with definition of list of that objects. 3) Include these files in cviolat.h file. 4) Compile and relink the whole system. ATTENTION: Tested with gcc v2.4.5 5) Generate data files to be read for an object: attributes and (item_constr). 6) Define constraints for evaluation on Aggregate (agg_constr) and Domain level (dom_constr). 7) Define list of repair steps (repairl) for each constraint. 8) Now you can start the programm and tune your repair steps list (repairl) for the chosen optimizing algorithm to achieve the best results.