Subset colour sets | CPN Tools help |
CPN ML |
colset name = subset name0 by subset-function;
The by
clause specifies a function whose return value is a boolean. The colour set name
will contain exactly those values from name0
that are mapped into the boolean value true
.
colset name = subset name0 with subset-list;
The with
clause specifies a list with elements from name0
. The colour set name
will contain exactly those values that are listed.
fun even i = (i mod 2)=0;
The function even
returns true
when i
is even and false
when i
is odd.
colset EvenInt = subset Int by even;
The colour set EvenInt
is a subset of the set of integers, and it contains only the even integers. A subset colour set is used in the example CP-net of the Distributed Database.
colset Weekend = subset Day with [Sat,Sun];
The colour set Weekend
is a subset of the colour set Day
which is an enumerated colour set.