Skip to content

Cargo Bike

The Cargo Bike is a product configuration problem written in the COOM[X*] language fragment. As this example contains unbounded cardinalities, the current encoding is not able to solve this natively. Therefore, the COOM Suite offers the --incremental-bounds option providing a simple approach which increases the maximum bound in a stepwise manner until reaching a solution. This approach is captured in the following diagram.

Workflow

Acknowledgements

The Cargo Bike example has been provided by denkbares.

Usage

coomsuite solve examples/coom/cargo-bike.coom --incremental-bounds

COOM model

product {
            num /l  0-200   totalVolume
            num /l  0-200   requestedVolume
    0..*    Bag             bags
}

structure Bag {
    Color color
    Size  size
}

enumeration Color { Green Blue Red }

enumeration Size {
    attribute num weight
    attribute num volume

    small   = ( 10 12 )
    medium  = ( 15 16 )
    large   = ( 25 20 )
}

behavior {
    explanation "The total volume is equal to the sum of the volumes of all bags."
    require totalVolume = sum(bags.size.volume)

    explanation "The total volume must be greater than or equal to the requested volume."

Example solution

Solving with max_bound = 1
UNSATISFIABLE

Solving with max_bound = 2
UNSATISFIABLE

Solving with max_bound = 3
Answer: 1
bags[0]
bags[1]
bags[2]
requestedVolume[0] = 60
totalVolume[0]     = 60

bags[0].size[0] = "large"
bags[0].size[0].volume[0] = 20
bags[0].size[0].weight[0] = 25

bags[1].size[0] = "large"
bags[1].size[0].volume[0] = 20
bags[1].size[0].weight[0] = 25

bags[2].size[0] = "large"
bags[2].size[0].volume[0] = 20
bags[2].size[0].weight[0] = 25

SATISFIABLE