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 totalVolume
and totalWeight
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 see that the sum over all instances of bags.size.maxWeight
is compared with the user entered value totalWeight
.
This also holds for bags.size.volume
and totalVolume
.
Here, we compute the sum over all currently existing 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 totalWeight
and totalVolume
.
product {
CargoBike cargoBike
}
structure CargoBike {
num /kg totalWeight
num /l totalVolume
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.volume) >= totalVolume
require sum(bags.size.maxWeight) >= totalWeight
}
behavior CargoBike {
imply countBags = count(bags)
minimize countBags
}