package Sequenic.T2.Engines; import java.util.* ; import org.junit.Test; public class CombinatoricSeqGeneratorTest { static public class C { public int x ; public void m1() { } public void m2() { } } static void printSequence(List seq) { System.out.print(">>> ") ; for (int i=0; i>> testing next_sequence ...") ; BaseEngine engine = new BaseEngine(C.class) ; CombinatoricSeqGenerator seqGen = new CombinatoricSeqGenerator(engine) ; seqGen.r = 3 ; seqGen.duplicates = 1 ; seqGen.init() ; seqGen.selectCombinatoricEngine(0) ; int N = seqGen.totalNumberOfCombinations() ; System.out.println("#comb(3,3) with dup=1 ... is " + N) ; assert N == 6 ; List seq ; for (int i=0; i>> testing next_sequence ... with multiple replicas ") ; BaseEngine engine = new BaseEngine(C.class) ; CombinatoricSeqGenerator seqGen = new CombinatoricSeqGenerator(engine) ; seqGen.r = 2 ; seqGen.duplicates = 2 ; seqGen.init() ; seqGen.selectCombinatoricEngine(0) ; int N = seqGen.totalNumberOfCombinations() ; System.out.println("#comb(3,2) with dup=2 ... is " + N) ; assert N == 12 ; List seq ; for (int i=0; i>> testing next_sequence ... with multiple constructors") ; BaseEngine engine = new BaseEngine(C2.class) ; CombinatoricSeqGenerator seqGen = new CombinatoricSeqGenerator(engine) ; seqGen.r = 2 ; seqGen.duplicates = 1 ; seqGen.init() ; seqGen.selectCombinatoricEngine(0) ; int N = seqGen.totalNumberOfCombinations() ; System.out.println("#comb(2,2) with dup=1 ... is " + N) ; assert N == 4 ; List seq ; for (int i=0; i>> testing the cartesian engine") ; BaseEngine engine = new BaseEngine(C.class) ; CombinatoricSeqGenerator seqGen = new CombinatoricSeqGenerator(engine) ; seqGen.r = 2 ; seqGen.duplicates = 1 ; seqGen.init() ; seqGen.selectCombinatoricEngine(1) ; int N = seqGen.totalNumberOfCombinations() ; System.out.println("#comb(3,2) with dup=1 ... is " + N) ; assert N == 9 ; List seq ; for (int i=0; i