COOM Profile: C-OPEN¶
Synopsis¶
The COOM C-OPEN profile allows for the representation of arbitrary cardinalities for a specific element. Here, the exact cardinality does not need to be defined in the knowledge base nor by the user during the configuration session. In contrast, the required number of instances is calculated by the reasoner based on constraints defined in the knowledge base.
Building Blocks¶
Example: Cargo Bike¶
The CargoBike
specializes in transporting luggage. The user enters the desired wantedVolume
and wantedWeight
of the items to be transported.
Subsequently, the reasoner calculates the required number of Bag
instances with their respective sizes
.
In the knowledge behavior definition we can see that the sum over all instances of bags.size.maxWeight
is captured in the totalWeight
value. This value indicates the total weight capacity of the CargoBike
. The totalWeight
is later compared with the user entered value wantedWeight
.
For volume requirements this also holds for bags.size.volume
, totalVolume
and wantedVolume
.
We compute the sum over all currently existing Bag
instances since no concrete index is given.
With this knowledge the reasoner must generate a sufficient number of Bag
instances, each with its corresponding size
, to ensure that the equations are satisfied.
To guide the reasoner during this process of instance generation, we include the optimization statement minimize countBags
.
This directive aims to generate the least amount of bags that still satisfies wantedWeight
and wantedVolume
.
product {
CargoBike cargoBike
}
structure CargoBike {
num /kg totalWeight
num /kg wantedWeight
num /l totalVolume
num /l wantedVolume
num countBags
0..99 Bag bags
}
structure Bag {
Color color
Size size
}
enumeration Color { Green Blue Red }
enumeration Size {
attribute num maxWeight
attribute num volume
small = ( 10 12 )
medium = ( 15 16 )
large = ( 25 20 )
}
behavior CargoBike {
require sum(bags.size.maxWeight) = totalWeight
require sum(bags.size.volume) = totalVolume
require totalWeight >= wantedWeight
require totalVolume >= wantedVolume
}
behavior CargoBike {
imply countBags = count(bags)
minimize countBags
}