Skip to content

Commit

Permalink
removed imply statements from examples and added references
Browse files Browse the repository at this point in the history
  • Loading branch information
nrueh committed Jul 2, 2024
1 parent 5916c47 commit d19c4af
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 20 deletions.
23 changes: 13 additions & 10 deletions examples/coom/box.coom
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Box example
// Taken from Andreas Falkner's slides
// Provided by Andreas Falkner
// adapted from Blumöhr et al.: Variant Configuration with SAP
// does not work with fclingo as there is multiplication between two variables

// If using area and volume features, the example does not work with fclingo
// as there is a (non-linear) multiplication between two variables.

product {
num 0-20 length
Expand Down Expand Up @@ -71,16 +73,17 @@ behavior {
require lid.length < length + 3
}

// imply statements
// Area and volume calculations
behavior {
imply area = length * width
require area = length * width

imply volume = area * height
require volume = area * height
}

// User requirements (becomes very slow when added here, instead of restricting the range)
// behavior {
// require volume > 5000
// User requirements (becomes very slow when added as a range, instead of restricting the range)
// Very fast when using "="
behavior {
require volume = 5040

// require volume < 5050
// }
// require volume <= 5040
}
4 changes: 4 additions & 0 deletions examples/coom/city-bike.coom
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// City Bike example
// Provided by denkbares GmbH
// see Baumeister et al.: Towards Industrial-scale Product Configuration (2024). To appear.

product {
Color color
0..1 Basket basket
Expand Down
4 changes: 4 additions & 0 deletions examples/coom/kids-bike.coom
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Kids Bike example
// Provided by denkbares GmbH
// see Baumeister et al.: Towards Industrial-scale Product Configuration (2024). To appear.

product {
Color color
bool wheelSupport
Expand Down
58 changes: 58 additions & 0 deletions examples/coom/metro.coom
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Metro wagon example
// Falkner et al.: Solver Requirements for Interactive Configuration (2020)

product {
num 10-20 length
num 50-200 num_passengers
num 0-200 standing_room

0..1 HandRail handrail
0..80 Seat seat
}

enumeration HandRail { Standard Premium}

structure HandRail {}

structure Seat {
SeatType type
Color color
}

enumeration SeatType { Standard Premium Special}
enumeration Color { Blue Red White }

behavior {
explanation "If there is standing room, a handrail is required."
condition standing_room > 0 require count(handrail) = 1

explanation "Max. 4 seats per meter length and one seat occupies the space of three standing passengers."
require count(seat) * 3 + standing_room <= 12 * length

explanation "Standard type cannot be mixed with premium."
combinations ( seat.type handrail )
allow ( Standard Standard )
allow ( Premium Premium )
allow ( Special -*- )

explanation "The number of passengers is equal to the number of seats plus standing room."
require num_passengers = count(seat) + standing_room
}

behavior Seat {
explanation "Seats of type Special must be red."
condition type = Special
require color = Red
}

// // Defaults (not implemented currently)
// behavior {
// default type = Standard

// default type = Blue

// default handrail.type = Standard

// explanation "All seats have to have the same color (except special seats)"
// default seat.color = seat.color
// }
8 changes: 4 additions & 4 deletions examples/coom/olympic-bus.coom
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Olympic bus example
// Taken from Andreas Falkner's slides
// Adapted from Yang & Dong, Journal of Intelligent Manufacturing, 2013
// Provided by Andreas Falkner
// Adapted from Yang & Dong, Journal of Intelligent Manufacturing (2013)

product {
0..80 Seat seat
Expand Down Expand Up @@ -49,9 +49,9 @@ behavior {
condition count(display) > 20
require count(dvdPlayer) > 1

imply totalPowerConsumption = sum(dvdPlayer.powerConsumption) + sum(seat.lamp.powerConsumption) + sum(display.powerConsumption)
require totalPowerConsumption = sum(dvdPlayer.powerConsumption) + sum(seat.lamp.powerConsumption) + sum(display.powerConsumption)

imply seatCount = count(seat)
require seatCount = count(seat)
}

// User requirements
Expand Down
9 changes: 6 additions & 3 deletions examples/coom/pc.coom
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// PC example
// Taken from Felfernig et al.: Knowledge-based Configuration: From Research to Business Cases. Elsevier (2014).

product {
Usage usage
Efficiency efficiency
Expand Down Expand Up @@ -89,7 +92,7 @@ structure Application {
}

behavior {
imply price = sum(hdunit.price) + motherboard.price + sum(motherboard.cpu.price)
require price = sum(hdunit.price) + motherboard.price + sum(motherboard.cpu.price)
+ os.price + sum(screen.price) + sum(applications.price)

require price <= maxPrice
Expand All @@ -112,11 +115,11 @@ behavior {
}

behavior HDUnit {
imply price = sum(hdisk.price) + sum(hdcontroller.price)
require price = sum(hdisk.price) + sum(hdcontroller.price)
}

behavior Motherboard {
imply price = mbtype.price
require price = mbtype.price

condition mbtype = MBSilver
require cpu != CPUD
Expand Down
31 changes: 31 additions & 0 deletions examples/coom/tiny-pc.coom
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Tiny PC example
// Provided by Andreas Falkner

product {
Usage usage
Efficiency efficiency
CPU cpu
}

enumeration Usage {
Internet
Scientific
Multimedia
}

structure CPU {
Clockrate clockrate
}

enumeration Clockrate {
Slow
Medium
Fast
}

behavior {
condition usage = Scientific
require cpu.clockrate = Fast

require ! (usage = Multimedia && cpu.clockrate = Slow)
}
6 changes: 5 additions & 1 deletion examples/coom/travel-bike-simplified.coom
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Simplified Travel Bike example
// Provided by denkbares GmbH
// see Baumeister et al.: Towards Industrial-scale Product Configuration (2024). To appear.

product {
num .#/l 0-200 totalVolume
num .#/l 200-200 requestedVolume
Expand All @@ -24,7 +28,7 @@ enumeration Bag {
behavior {
require count(carrier.bag) + count(frame.bag) <= 4

imply totalVolume = sum(carrier.bag.volume) + sum(frame.bag.volume)
require totalVolume = sum(carrier.bag.volume) + sum(frame.bag.volume)

require totalVolume >= requestedVolume
}
8 changes: 6 additions & 2 deletions examples/coom/travel-bike.coom
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Travel Bike example
// Provided by denkbares GmbH
// see Baumeister et al.: Towards Industrial-scale Product Configuration (2024). To appear.

product {
num .#/g 1-10000 totalWeight
num .#/kg 10-10 maxWeight
Expand Down Expand Up @@ -60,13 +64,13 @@ enumeration Color {
behavior {
require count(carrier.bag) + count(frame.bag) <= 4

imply totalWeight = frontWheel.weight + rearWheel.weight
require totalWeight = frontWheel.weight + rearWheel.weight
+ sum(carrier.bag.capacity.weight)
+ sum(frame.bag.capacity.weight)

require totalWeight <= maxWeight * 1000

imply totalVolume = sum(carrier.bag.capacity.volume) + sum(frame.bag.capacity.volume)
require totalVolume = sum(carrier.bag.capacity.volume) + sum(frame.bag.capacity.volume)

require totalVolume >= requestedVolume

Expand Down
4 changes: 4 additions & 0 deletions examples/coom/tshirt.coom
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// T-shirt example
// Provided by denkbares GmbH
// Adapted from A. Haag and L. Haag: Further Empowering Variant Tables for Mass Customization (2019)

product {
Color color
Size size
Expand Down

0 comments on commit d19c4af

Please sign in to comment.