This module generates sequences of states sets, i.e., having present their elements or not, (represented as lists).
To specify the configuration of the sets a list must be created of the form [NameSet1-NObjects1, NameSet2-NObjects2 ...]. Each step of the sequence is composed of an atom p(Name, List), with the List of length NObjects of the set.
This is an example to create a sequence in which elements are added 1 by 1 until the sets have all their elements present. In this case we are using the number 1 to mark that an element is present:
?- gen_edit_sequence([m3-1, m2-1, m1-2], cfg(4, 4, 1, 1,0,4), gen_num_sequence, S).
S =[[p(m3,[1]),p(m2,[_]),p(m1,[_,_])],
[p(m3,[1]),p(m2,[1]),p(m1,[_,_])],
[p(m3,[1]),p(m2,[1]),p(m1,[1,_])],
[p(m3,[1]),p(m2,[1]),p(m1,[1,1])]]
?
yes
?-An example to get a sequence in which elements are added 2 by 2 and randomly: ?- gen_edit_sequence([set1-3, set2-1, set3-2], cfg(6, 3, 2, 1, 0, 3), gen_random_sorted_sequence, S).
S = [[p(set1,[_,_,_]),p(set2,[_]),p(set3,[_,_])],
[p(set1,[_,1,_]),p(set2,[1]),p(set3,[_,_])],
[p(set1,[_,1,_]),p(set2,[1]),p(set3,[1,1])],
[p(set1,[1,1,1]),p(set2,[1]),p(set3,[1,1])]] ?
yes
?- Usage:gen_edit_sequence(Mods,SeqConfig,SeqGenerator,Seq)
Usage:gen_random_sorted_sequence(NNumbers,Low,Up,Seq)
Generates a random sequence of different numbers with length NNumbers .