1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package org.sat4j.pb;
31
32 import org.sat4j.core.ASolverFactory;
33 import org.sat4j.minisat.core.IOrder;
34 import org.sat4j.minisat.core.IPhaseSelectionStrategy;
35 import org.sat4j.minisat.core.Solver;
36 import org.sat4j.minisat.learning.ClauseOnlyLearning;
37 import org.sat4j.minisat.learning.MiniSATLearning;
38 import org.sat4j.minisat.learning.NoLearningButHeuristics;
39 import org.sat4j.minisat.orders.PhaseInLastLearnedClauseSelectionStrategy;
40 import org.sat4j.minisat.orders.RSATPhaseSelectionStrategy;
41 import org.sat4j.minisat.orders.UserFixedPhaseSelectionStrategy;
42 import org.sat4j.minisat.orders.VarOrderHeap;
43 import org.sat4j.minisat.restarts.ArminRestarts;
44 import org.sat4j.minisat.restarts.Glucose21Restarts;
45 import org.sat4j.minisat.restarts.LubyRestarts;
46 import org.sat4j.minisat.restarts.MiniSATRestarts;
47 import org.sat4j.minisat.restarts.NoRestarts;
48 import org.sat4j.pb.constraints.AbstractPBDataStructureFactory;
49 import org.sat4j.pb.constraints.CompetMinHTmixedClauseCardConstrDataStructureFactory;
50 import org.sat4j.pb.constraints.CompetResolutionMinPBLongMixedWLClauseCardConstrDataStructure;
51 import org.sat4j.pb.constraints.CompetResolutionPBLongMixedHTClauseCardConstrDataStructure;
52 import org.sat4j.pb.constraints.CompetResolutionPBLongMixedWLClauseCardConstrDataStructure;
53 import org.sat4j.pb.constraints.CompetResolutionPBMixedHTClauseCardConstrDataStructure;
54 import org.sat4j.pb.constraints.CompetResolutionPBMixedWLClauseCardConstrDataStructure;
55 import org.sat4j.pb.constraints.PBLongMaxClauseCardConstrDataStructure;
56 import org.sat4j.pb.constraints.PBLongMinClauseCardConstrDataStructure;
57 import org.sat4j.pb.constraints.PBMaxClauseAtLeastConstrDataStructure;
58 import org.sat4j.pb.constraints.PBMaxClauseCardConstrDataStructure;
59 import org.sat4j.pb.constraints.PBMaxDataStructure;
60 import org.sat4j.pb.constraints.PBMinClauseCardConstrDataStructure;
61 import org.sat4j.pb.constraints.PBMinDataStructure;
62 import org.sat4j.pb.constraints.PuebloPBMinClauseAtLeastConstrDataStructure;
63 import org.sat4j.pb.constraints.PuebloPBMinClauseCardConstrDataStructure;
64 import org.sat4j.pb.constraints.PuebloPBMinDataStructure;
65 import org.sat4j.pb.core.PBDataStructureFactory;
66 import org.sat4j.pb.core.PBSolver;
67 import org.sat4j.pb.core.PBSolverCP;
68 import org.sat4j.pb.core.PBSolverCautious;
69 import org.sat4j.pb.core.PBSolverClause;
70 import org.sat4j.pb.core.PBSolverResCP;
71 import org.sat4j.pb.core.PBSolverResolution;
72 import org.sat4j.pb.core.PBSolverWithImpliedClause;
73 import org.sat4j.pb.orders.VarOrderHeapObjective;
74 import org.sat4j.pb.tools.ManyCorePB;
75
76
77
78
79
80
81
82 public final class SolverFactory extends ASolverFactory<IPBSolver> {
83
84
85
86
87 private static final long serialVersionUID = 1L;
88
89
90 private static SolverFactory instance;
91
92
93
94
95
96
97 private SolverFactory() {
98
99 }
100
101 private static synchronized void createInstance() {
102 if (instance == null) {
103 instance = new SolverFactory();
104 }
105 }
106
107
108
109
110
111
112 public static SolverFactory instance() {
113 if (instance == null) {
114 createInstance();
115 }
116 return instance;
117 }
118
119
120
121
122
123 public static PBSolverResolution newPBResAllPB() {
124 return newPBRes(new PBMaxDataStructure());
125 }
126
127
128
129
130
131 public static PBSolverCP newPBCPAllPB() {
132 return newPBCP(new PBMaxDataStructure());
133 }
134
135
136
137
138 public static IPBSolver newOPBStringSolver() {
139 return new OPBStringSolver();
140 }
141
142
143
144
145
146
147 public static PBSolverCP newPBCPMixedConstraints() {
148 return newPBCP(new PBMaxClauseCardConstrDataStructure());
149 }
150
151
152
153
154
155
156
157 public static PBSolverCP newPBCPMixedConstraintsObjective() {
158 return newPBCP(new PBMaxClauseCardConstrDataStructure(),
159 new VarOrderHeapObjective());
160 }
161
162 public static PBSolverCP newCompetPBCPMixedConstraintsObjective() {
163 return newPBCP(new PBMaxClauseCardConstrDataStructure(),
164 new VarOrderHeapObjective());
165 }
166
167 public static PBSolverCP newCompetPBCPMixedConstraintsMinObjective() {
168 return newPBCP(new PBMinClauseCardConstrDataStructure(),
169 new VarOrderHeapObjective());
170 }
171
172 public static PBSolverCP newCompetPBCPMixedConstraintsLongMaxObjective() {
173 return newPBCP(new PBLongMaxClauseCardConstrDataStructure(),
174 new VarOrderHeapObjective());
175 }
176
177 public static PBSolverCP newCompetPBCPMixedConstraintsLongMinObjective() {
178 return newPBCP(new PBLongMinClauseCardConstrDataStructure(),
179 new VarOrderHeapObjective());
180 }
181
182
183
184
185
186
187
188
189
190 public static PBSolverCP newPBCPMixedConstraintsObjectiveLearnJustClauses() {
191 ClauseOnlyLearning<PBDataStructureFactory> learning = new ClauseOnlyLearning<PBDataStructureFactory>();
192 PBSolverCP solver = new PBSolverCP(learning,
193 new PBMaxClauseCardConstrDataStructure(),
194 new VarOrderHeapObjective());
195 return solver;
196 }
197
198 public static PBSolverCP newCompetPBCPMixedConstraintsObjectiveLearnJustClauses() {
199 ClauseOnlyLearning<PBDataStructureFactory> learning = new ClauseOnlyLearning<PBDataStructureFactory>();
200 PBSolverCP solver = new PBSolverCP(learning,
201 new PBMaxClauseCardConstrDataStructure(),
202 new VarOrderHeapObjective());
203 return solver;
204 }
205
206 private static PBSolverCP newPBKiller(IPhaseSelectionStrategy phase) {
207 ClauseOnlyLearning<PBDataStructureFactory> learning = new ClauseOnlyLearning<PBDataStructureFactory>();
208 PBSolverCP solver = new PBSolverCP(learning,
209 new PBMaxClauseCardConstrDataStructure(),
210 new VarOrderHeapObjective(phase));
211 return solver;
212 }
213
214 public static PBSolverCP newPBKillerRSAT() {
215 return newPBKiller(new RSATPhaseSelectionStrategy());
216 }
217
218 public static PBSolverCP newPBKillerClassic() {
219 return newPBKiller(new PhaseInLastLearnedClauseSelectionStrategy());
220 }
221
222 public static PBSolverCP newPBKillerFixed() {
223 return newPBKiller(new UserFixedPhaseSelectionStrategy());
224 }
225
226 private static PBSolverCP newCompetPBKiller(IPhaseSelectionStrategy phase) {
227 ClauseOnlyLearning<PBDataStructureFactory> learning = new ClauseOnlyLearning<PBDataStructureFactory>();
228 PBSolverCP solver = new PBSolverCP(learning,
229 new PBMaxClauseCardConstrDataStructure(),
230 new VarOrderHeapObjective(phase));
231 return solver;
232 }
233
234 public static PBSolverCP newCompetPBKillerRSAT() {
235 return newCompetPBKiller(new RSATPhaseSelectionStrategy());
236 }
237
238 public static PBSolverCP newCompetPBKillerClassic() {
239 return newCompetPBKiller(new PhaseInLastLearnedClauseSelectionStrategy());
240 }
241
242 public static PBSolverCP newCompetPBKillerFixed() {
243 return newCompetPBKiller(new UserFixedPhaseSelectionStrategy());
244 }
245
246
247
248
249
250
251
252
253 public static PBSolverCP newMiniLearningOPBClauseCardConstrMaxSpecificOrderIncrementalReductionToClause() {
254
255 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
256
257 PBSolverCP solver = new PBSolverClause(learning,
258 new PBMaxClauseCardConstrDataStructure(),
259 new VarOrderHeapObjective());
260 learning.setDataStructureFactory(solver.getDSFactory());
261 learning.setVarActivityListener(solver);
262 return solver;
263 }
264
265
266
267
268
269
270
271
272 public static PBSolverCP newPBCPMixedConstraintsObjectiveNoLearning() {
273 NoLearningButHeuristics<PBDataStructureFactory> learning = new NoLearningButHeuristics<PBDataStructureFactory>();
274
275 PBSolverCP solver = new PBSolverCP(learning,
276 new PBMaxClauseCardConstrDataStructure(),
277 new VarOrderHeapObjective());
278 learning.setVarActivityListener(solver);
279 return solver;
280 }
281
282 public static PBSolverResolution newPBResMixedConstraintsObjective() {
283 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
284 PBSolverResolution solver = new PBSolverResolution(learning,
285 new PBMaxClauseCardConstrDataStructure(),
286 new VarOrderHeapObjective(), new MiniSATRestarts());
287 learning.setDataStructureFactory(solver.getDSFactory());
288 learning.setVarActivityListener(solver);
289 return solver;
290 }
291
292 public static PBSolverResolution newCompetPBResWLMixedConstraintsObjectiveExpSimp() {
293 return newCompetPBResMixedConstraintsObjectiveExpSimp(new CompetResolutionPBMixedWLClauseCardConstrDataStructure());
294 }
295
296 public static PBSolverResolution newCompetPBResHTMixedConstraintsObjectiveExpSimp() {
297 return newCompetPBResMixedConstraintsObjectiveExpSimp(new CompetResolutionPBMixedHTClauseCardConstrDataStructure());
298 }
299
300 public static PBSolverResolution newCompetPBResLongHTMixedConstraintsObjectiveExpSimp() {
301 return newCompetPBResMixedConstraintsObjectiveExpSimp(new CompetResolutionPBLongMixedHTClauseCardConstrDataStructure());
302 }
303
304 public static PBSolverResolution newCompetPBResLongWLMixedConstraintsObjectiveExpSimp() {
305 return newCompetPBResMixedConstraintsObjectiveExpSimp(new CompetResolutionPBLongMixedWLClauseCardConstrDataStructure());
306 }
307
308 public static PBSolverResolution newCompetMinPBResLongWLMixedConstraintsObjectiveExpSimp() {
309 return newCompetPBResMixedConstraintsObjectiveExpSimp(new CompetResolutionMinPBLongMixedWLClauseCardConstrDataStructure());
310 }
311
312 public static PBSolverResolution newCompetPBResMixedConstraintsObjectiveExpSimp(
313 PBDataStructureFactory dsf) {
314 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
315 PBSolverResolution solver = new PBSolverResolution(learning, dsf,
316 new VarOrderHeapObjective(new RSATPhaseSelectionStrategy()),
317 new ArminRestarts());
318 learning.setDataStructureFactory(solver.getDSFactory());
319 learning.setVarActivityListener(solver);
320 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
321 return solver;
322 }
323
324 public static PBSolverResolution newPBResHTMixedConstraintsObjective() {
325 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
326 AbstractPBDataStructureFactory ds = new CompetResolutionPBMixedHTClauseCardConstrDataStructure();
327 ds.setNormalizer(AbstractPBDataStructureFactory.NO_COMPETITION);
328 PBSolverResolution solver = new PBSolverResolution(learning, ds,
329 new VarOrderHeapObjective(), new MiniSATRestarts());
330 learning.setDataStructureFactory(solver.getDSFactory());
331 learning.setVarActivityListener(solver);
332 return solver;
333 }
334
335 public static PBSolverResolution newCompetPBResMinHTMixedConstraintsObjective() {
336 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
337 PBSolverResolution solver = new PBSolverResolution(learning,
338 new CompetMinHTmixedClauseCardConstrDataStructureFactory(),
339 new VarOrderHeapObjective(), new MiniSATRestarts());
340 learning.setDataStructureFactory(solver.getDSFactory());
341 learning.setVarActivityListener(solver);
342 return solver;
343 }
344
345 public static PBSolverResolution newPBResMinHTMixedConstraintsObjective() {
346 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
347 AbstractPBDataStructureFactory ds = new CompetMinHTmixedClauseCardConstrDataStructureFactory();
348 ds.setNormalizer(AbstractPBDataStructureFactory.NO_COMPETITION);
349 PBSolverResolution solver = new PBSolverResolution(learning, ds,
350 new VarOrderHeapObjective(), new MiniSATRestarts());
351 learning.setDataStructureFactory(solver.getDSFactory());
352 learning.setVarActivityListener(solver);
353 return solver;
354 }
355
356 public static PBSolverResolution newCompetPBResMixedConstraintsObjectiveExpSimp() {
357 PBSolverResolution solver = newPBResMixedConstraintsObjective();
358 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
359 return solver;
360 }
361
362 public static PBSolverResolution newPBResHTMixedConstraintsObjectiveExpSimp() {
363 PBSolverResolution solver = newPBResHTMixedConstraintsObjective();
364 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
365 return solver;
366 }
367
368 public static PBSolverResolution newCompetPBResMinHTMixedConstraintsObjectiveExpSimp() {
369 PBSolverResolution solver = newCompetPBResMinHTMixedConstraintsObjective();
370 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
371 return solver;
372 }
373
374
375
376
377
378
379
380
381 public static PBSolverClause newPBCPMixedConstraintsReduceToClause() {
382 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
383 PBSolverClause solver = new PBSolverClause(learning,
384 new PBMaxClauseCardConstrDataStructure(), new VarOrderHeap());
385 learning.setDataStructureFactory(solver.getDSFactory());
386 learning.setVarActivityListener(solver);
387 return solver;
388 }
389
390
391
392
393
394
395
396
397 public static PBSolverCautious newPBCPMixedConstraintsCautious(int bound) {
398 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
399 PBSolverCautious solver = new PBSolverCautious(learning,
400 new PBMaxClauseCardConstrDataStructure(),
401 new VarOrderHeapObjective(), bound);
402 learning.setDataStructureFactory(solver.getDSFactory());
403 learning.setVarActivityListener(solver);
404 return solver;
405 }
406
407 public static PBSolverCautious newPBCPMixedConstraintsCautious() {
408 return newPBCPMixedConstraintsCautious(PBSolverCautious.BOUND);
409 }
410
411
412
413
414
415
416
417
418 public static PBSolverResCP newPBCPMixedConstraintsResCP(long bound) {
419 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
420 PBSolverResCP solver = new PBSolverResCP(learning,
421 new PBMaxClauseCardConstrDataStructure(),
422 new VarOrderHeapObjective(), bound);
423 learning.setDataStructureFactory(solver.getDSFactory());
424 learning.setVarActivityListener(solver);
425 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
426 return solver;
427 }
428
429 public static PBSolverResCP newPBCPMixedConstraintsResCP() {
430 return newPBCPMixedConstraintsResCP(PBSolverResCP.MAXCONFLICTS);
431 }
432
433
434
435
436
437
438
439 public static PBSolverWithImpliedClause newPBCPMixedConstrainsImplied() {
440 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
441 PBSolverWithImpliedClause solver = new PBSolverWithImpliedClause(
442 learning, new PBMaxClauseCardConstrDataStructure(),
443 new VarOrderHeap());
444 learning.setDataStructureFactory(solver.getDSFactory());
445 learning.setVarActivityListener(solver);
446 return solver;
447 }
448
449
450
451
452
453
454
455
456 public static PBSolverCP newMiniOPBClauseAtLeastConstrMax() {
457 return newPBCP(new PBMaxClauseAtLeastConstrDataStructure());
458 }
459
460
461
462
463
464 public static PBSolverResolution newPBResAllPBWL() {
465 return newPBRes(new PBMinDataStructure());
466 }
467
468
469
470
471
472 public static PBSolverCP newPBCPAllPBWL() {
473 return newPBCP(new PBMinDataStructure());
474 }
475
476
477
478
479
480 public static PBSolverResolution newPBResAllPBWLPueblo() {
481 return newPBRes(new PuebloPBMinDataStructure());
482 }
483
484 private static PBSolverResolution newPBRes(PBDataStructureFactory dsf) {
485 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
486 PBSolverResolution solver = new PBSolverResolution(learning, dsf,
487 new VarOrderHeap(), new MiniSATRestarts());
488 learning.setDataStructureFactory(solver.getDSFactory());
489 learning.setVarActivityListener(solver);
490 return solver;
491 }
492
493
494
495
496
497 public static PBSolverCP newPBCPAllPBWLPueblo() {
498 return newPBCP(new PuebloPBMinDataStructure());
499 }
500
501
502
503
504
505 public static PBSolverCP newMiniOPBClauseCardMinPueblo() {
506 return newPBCP(new PuebloPBMinClauseCardConstrDataStructure());
507 }
508
509
510
511
512
513 public static PBSolverCP newMiniOPBClauseCardMin() {
514 return newPBCP(new PBMinClauseCardConstrDataStructure());
515 }
516
517
518
519
520
521 public static PBSolverCP newMiniOPBClauseAtLeastMinPueblo() {
522 return newPBCP(new PuebloPBMinClauseAtLeastConstrDataStructure());
523 }
524
525 private static PBSolverCP newPBCP(PBDataStructureFactory dsf, IOrder order) {
526 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
527 PBSolverCP solver = new PBSolverCP(learning, dsf, order);
528 learning.setDataStructureFactory(solver.getDSFactory());
529 learning.setVarActivityListener(solver);
530 solver.setRestartStrategy(new ArminRestarts());
531 solver.setLearnedConstraintsDeletionStrategy(solver.glucose);
532 return solver;
533 }
534
535 private static PBSolverCP newPBCP(PBDataStructureFactory dsf) {
536 return newPBCP(dsf, new VarOrderHeap());
537 }
538
539
540
541
542
543
544
545 public static IPBSolver newCuttingPlanes() {
546 return newCompetPBCPMixedConstraintsObjective();
547 }
548
549
550
551
552
553
554
555 public static IPBSolver newCuttingPlanesAggressiveCleanup() {
556 PBSolverCP solver = newCompetPBCPMixedConstraintsObjective();
557 solver.setLearnedConstraintsDeletionStrategy(solver.fixedSize(100));
558 return solver;
559 }
560
561
562
563
564
565
566
567 public static IPBSolver newResolution() {
568 return newResolutionGlucoseExpSimp();
569 }
570
571
572
573
574
575
576
577
578 public static IPBSolver newBoth() {
579 return new ManyCorePB(newResolution(), newCuttingPlanes());
580 }
581
582
583
584
585
586
587
588 public static IPBSolver newSATUNSAT() {
589 return new ManyCorePB(newSAT(), newUNSAT());
590 }
591
592
593
594
595
596
597 public static PBSolverResolution newSAT() {
598 PBSolverResolution solver = newResolutionGlucose();
599 solver.setRestartStrategy(new LubyRestarts(100));
600 solver.setLearnedConstraintsDeletionStrategy(solver.memory_based);
601 return solver;
602 }
603
604
605
606
607
608
609 public static PBSolverResolution newUNSAT() {
610 PBSolverResolution solver = newResolutionGlucose();
611 solver.setRestartStrategy(new NoRestarts());
612 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
613 return solver;
614 }
615
616
617
618
619
620
621
622
623
624 public static PBSolverResolution newResolutionGlucose() {
625 PBSolverResolution solver = newCompetPBResLongWLMixedConstraintsObjectiveExpSimp();
626 solver.setSimplifier(Solver.NO_SIMPLIFICATION);
627 solver.setRestartStrategy(new Glucose21Restarts());
628 solver.setLearnedConstraintsDeletionStrategy(solver.glucose);
629 return solver;
630 }
631
632
633
634
635
636
637
638
639
640
641 public static PBSolverResolution newResolutionGlucose21() {
642 PBSolverResolution solver = newResolutionGlucose();
643 solver.setRestartStrategy(new Glucose21Restarts());
644 return solver;
645 }
646
647
648
649
650
651
652
653
654 public static PBSolverResolution newResolutionGlucoseSimpleSimp() {
655 PBSolverResolution solver = newResolutionGlucose();
656 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
657 return solver;
658 }
659
660
661
662
663
664
665
666
667
668
669 public static PBSolverResolution newResolutionGlucoseExpSimp() {
670 PBSolverResolution solver = newResolutionGlucose();
671 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
672 return solver;
673 }
674
675
676
677
678
679
680
681
682 public static IPBSolver newSimpleSimplification() {
683 PBSolverResolution solver = newCompetPBResWLMixedConstraintsObjectiveExpSimp();
684 solver.setLearnedConstraintsDeletionStrategy(solver.glucose);
685 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
686 return solver;
687 }
688
689
690
691
692
693
694
695
696 public static IPBSolver newResolutionSimpleRestarts() {
697 PBSolverResolution solver = newCompetPBResLongWLMixedConstraintsObjectiveExpSimp();
698 solver.setLearnedConstraintsDeletionStrategy(solver.glucose);
699 solver.setRestartStrategy(new MiniSATRestarts());
700 return solver;
701 }
702
703
704
705
706
707
708
709
710
711 public static IPBSolver newResolutionMaxMemory() {
712 PBSolverResolution solver = newCompetPBResLongWLMixedConstraintsObjectiveExpSimp();
713 solver.setLearnedConstraintsDeletionStrategy(solver.memory_based);
714 return solver;
715 }
716
717
718
719
720
721
722
723
724
725 public static PBSolver newDefault() {
726 return newResolutionGlucose21();
727 }
728
729
730
731
732
733
734
735
736
737 public static IPBSolver newDefaultNonNormalized() {
738 PBSolver solver = newDefault();
739 CompetResolutionPBLongMixedWLClauseCardConstrDataStructure ds = new CompetResolutionPBLongMixedWLClauseCardConstrDataStructure();
740 ds.setNormalizer(AbstractPBDataStructureFactory.NO_COMPETITION);
741 solver.setDataStructureFactory(ds);
742 return solver;
743 }
744
745
746
747
748
749
750
751
752 @Override
753 public PBSolver defaultSolver() {
754 return newDefault();
755 }
756
757
758
759
760
761
762
763
764
765 public static IPBSolver newDefaultOptimizer() {
766 return new OptToPBSATAdapter(new PseudoOptDecorator(newDefault()));
767 }
768
769
770
771
772
773
774
775
776 public static IPBSolver newLight() {
777 return newCompetPBResMixedConstraintsObjectiveExpSimp();
778 }
779
780 @Override
781 public IPBSolver lightSolver() {
782 return newLight();
783 }
784
785 public static IPBSolver newEclipseP2() {
786 MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
787 PBSolverResolution solver = new PBSolverResolution(learning,
788 new CompetResolutionPBMixedHTClauseCardConstrDataStructure(),
789 new VarOrderHeapObjective(new RSATPhaseSelectionStrategy()),
790 new ArminRestarts());
791 learning.setDataStructureFactory(solver.getDSFactory());
792 learning.setVarActivityListener(solver);
793 solver.setTimeoutOnConflicts(300);
794 solver.setVerbose(false);
795 solver.setLearnedConstraintsDeletionStrategy(solver.memory_based);
796 return new OptToPBSATAdapter(new PseudoOptDecorator(solver));
797 }
798
799 }