generated from potassco/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from potassco/open-bounds
Open bounds
- Loading branch information
Showing
17 changed files
with
488 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
%%% COOM model | ||
coom_structure("product"). | ||
coom_feature("product","totalVolume","num",1,1). | ||
coom_range("product","totalVolume",0,200). | ||
coom_feature("product","requestedVolume","num",1,1). | ||
coom_range("product","requestedVolume",0,200). | ||
coom_feature("product","bags","Bag",0,#sup). | ||
|
||
coom_structure("Bag"). | ||
coom_feature("Bag","color","Color",1,1). | ||
coom_feature("Bag","size","Size",1,1). | ||
|
||
coom_enumeration("Color"). | ||
coom_option("Color", "Green"). | ||
coom_option("Color", "Blue"). | ||
coom_option("Color", "Red"). | ||
|
||
coom_enumeration("Size"). | ||
coom_attribute("Size","weight","num"). | ||
coom_attribute("Size","volume","num"). | ||
coom_option("Size", "small"). | ||
coom_attribute_value("Size","small","weight",10). | ||
coom_attribute_value("Size","small","volume",12). | ||
coom_option("Size", "medium"). | ||
coom_attribute_value("Size","medium","weight",15). | ||
coom_attribute_value("Size","medium","volume",16). | ||
coom_option("Size", "large"). | ||
coom_attribute_value("Size","large","weight",25). | ||
coom_attribute_value("Size","large","volume",20). | ||
|
||
coom_behavior(0). | ||
coom_context(0,"product"). | ||
coom_require(0,"sum(bags.size.volume)=totalVolume"). | ||
coom_binary("sum(bags.size.volume)=totalVolume","sum(bags.size.volume)","=","totalVolume"). | ||
coom_function("product","sum(bags.size.volume)","sum","bags.size.volume"). | ||
coom_path("bags.size.volume",0,"bags"). | ||
coom_path("bags.size.volume",1,"size"). | ||
coom_path("bags.size.volume",2,"volume"). | ||
coom_path("totalVolume",0,"totalVolume"). | ||
|
||
coom_behavior(1). | ||
coom_context(1,"product"). | ||
coom_require(1,"totalVolume>=requestedVolume"). | ||
coom_binary("totalVolume>=requestedVolume","totalVolume",">=","requestedVolume"). | ||
coom_path("totalVolume",0,"totalVolume"). | ||
coom_path("requestedVolume",0,"requestedVolume"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
product { | ||
// num /kg 0-200 totalWeight | ||
// num /kg 0-200 wantedWeight | ||
num /l 0-200 totalVolume | ||
num /l 0-200 requestedVolume | ||
// num countBags | ||
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 { | ||
// require sum(bags.size.maxWeight) = totalWeight | ||
require sum(bags.size.volume) = totalVolume | ||
|
||
// require totalWeight >= wantedWeight | ||
require totalVolume >= requestedVolume | ||
|
||
} | ||
|
||
// behavior { | ||
// imply countBags = count(bags) | ||
// minimize countBags | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
set color[0] = Yellow | ||
// set color[0] = Yellow | ||
// set size[0] = 14 | ||
// add basket[0] | ||
// add carrier[0].bag[0] | ||
// add carrier[0].bag[1] | ||
set requestedVolume[0] = 95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
value(X,V) :- user_value(X,V). | ||
include(X) :- user_include(X). | ||
value(X,V) :- user_value(X,V), type(X,T), discrete(T), domain(T,V). | ||
value(X,V) :- user_value(X,V), type(X,T), integer(T), range(T,Min,Max), Min <= V <= Max. | ||
include(X) :- user_include(X), type(X,T), part(T). |
Oops, something went wrong.