/* generator for translog domain */ #include #include #include #include #define NUM_ATOMSET1 2 #define NUM_ATOMSET2 7 #define NUM_ATOMSET3 2 #define NUM_ATOMSET4 15 #define NUM_ATOMSET5 24 void print_atomSet1N2(); void print_atomSet3(); void print_atomSet4(); void print_constants(); void print_tools(); /* Make 50% chance that the either of the following atoms are included in a problem (either all these atoms are included or none is included) */ char * atomSet1[NUM_ATOMSET1] = { "\t(processingArea hHor3) (type hHor3 horizontalOutline) (partOf hHor3 wp)", "\t(processingArea hHor3) (type hHor3 processingArea) (partOf hHor3 wp)" }; /* If the atoms from above are included, make 20% chance for each of the following pairs of atoms to be included (either both atoms in the pair are included or none) */ char * atomSet2[NUM_ATOMSET2] = { "\t(processingArea thr1) (type thr1 thread) (partOf thr1 hHor3)", "\t(processingArea thr2) (type thr2 thread) (partOf thr2 hHor3)", "\t(processingArea drillH1) (type drillH1 drilledHole) (partOf drillH1 hHor3)", "\t(processingArea ucut1) (type ucut1 undercut) (partOf ucut1 hHor3)", "\t(processingArea grov1) (type grov1 groove) (partOf grov1 hHor3)", "\t(processingArea slp1) (type slp1 slope) (partOf slp1 hHor3)", "\t(processingArea rof1) (type rof1 roundOff) (partOf rof1 hHor3)" }; /* Make 35% chances that one of the two following pair of atoms are included (chose randomly one of these pairs if the 35% chance succeeds) */ char * atomSet3[NUM_ATOMSET3] = { "\t(processingArea thr3) (type thr3 thread) (partOf thr3 hHor1)", "\t(processingArea thr3) (type thr3 thread) (partOf thr3 hHor2)" }; /* Make 20% chance for each of the following pairs of atoms to be included */ char * atomSet4[NUM_ATOMSET4] = { "\t(processingArea drillH2) (type drillH2 drilledHole) (partOf drillH2 hHor1)", "\t(processingArea ucut2) (type ucut2 undercut) (partOf ucut2 hHor1)", "\t(processingArea grov2) (type grov2 groove) (partOf grov2 hHor1)", "\t(processingArea slp2) (type slp2 slope) (partOf slp2 hHor1)", "\t(processingArea rof2) (type rof2 roundOff) (partOf rof2 hHor1)", "\t(processingArea drillH3) (type drillH3 drilledHole) (partOf drillH3 hHor2)", "\t(processingArea ucut3) (type ucut3 undercut) (partOf ucut3 hHor2)", "\t(processingArea grov3) (type grov3 groove) (partOf grov3 hHor2)", "\t(processingArea slp3) (type slp3 slope) (partOf slp3 hHor2)", "\t(processingArea rof3) (type rof3 roundOff) (partOf rof3 hHor2)", "\t(processingArea drillH4) (type drillH4 drilledHole) (partOf drillH4 hHor1)", "\t(processingArea ucut4) (type ucut4 undercut) (partOf ucut4 hHor2)", "\t(processingArea grov4) (type grov4 groove) (partOf grov4 hHor1)", "\t(processingArea slp4) (type slp4 slope) (partOf slp4 hHor2)", "\t(processingArea rof4) (type rof4 roundOff) (partOf rof4 hHor1)"}; /* tools */ char * atomSet5[NUM_ATOMSET5] = { "\t(tool t1) (type t1 outlnTool)", "\t(tool t2) (type t2 threadTool)", "\t(tool t3) (type t3 drilledHoleTool)", "\t(tool t4) (type t4 grooveTool)", "\t(tool t5) (type t5 slopeTool)", "\t(tool t6) (type t6 roundOffTool)", "\t(tool t7) (type t7 cuttingTool)", "\t(tool t8) (type t8 cuttingTool)", "\t(tool t9) (type t9 outlnTool)", "\t(tool t10) (type t10 threadTool)", "\t(tool t11) (type t11 drilledHoleTool)", "\t(tool t12) (type t12 grooveTool)", "\t(tool t13) (type t13 slopeTool)", "\t(tool t14) (type t14 roundOffTool)", "\t(tool t15) (type t15 cuttingTool)", "\t(tool t16) (type t16 cuttingTool)", "\t(tool t17) (type t17 outlnTool)", "\t(tool t18) (type t18 threadTool)", "\t(tool t19) (type t19 drilledHoleTool)", "\t(tool t20) (type t20 grooveTool)", "\t(tool t21) (type t21 slopeTool)", "\t(tool t22) (type t22 roundOffTool)", "\t(tool t23) (type t23 cuttingTool)", "\t(tool t24) (type t24 cuttingTool)" }; void main(int argc, char *argv[]) { int num_problem; srandom(time(NULL)); /* write the problem file for SHOP */ cout<<"(defproblem "<<"processPlanning"<