gips-tests/gipsl.all.build.varsobjective/src/gipsl/all/build/varsobjective/Model.gipsl
Maximilian Kratz 0c7e4eea2c Removes duplex host edges in all GIPSL specifications
gipsl.all.build.model: EOpposite for host + guests and removes duplex edges in GIPSL specifications
Removes duplex host edges in all other GIPSL projects
2023-04-06 15:43:38 +02:00

66 lines
1.2 KiB
Plaintext

package "gipsl.all.build.varsobjective"
import "platform:/resource/gipsl.all.build.model/model/Model.ecore"
import "http://www.eclipse.org/emf/2002/Ecore"
config {
solver := GLPK [home:="fu", license:="bar"];
timeLimit := true [value := 10.0];
randomSeed := true [value := 0];
presolve := true;
debugOutput := true;
// lpOutput := true [path := "./GLPK.lp"];
}
rule mapVnode {
root: Root {
-containers -> substrateContainer
-containers -> virtualContainer
}
substrateContainer: SubstrateContainer {
-substrateNodes -> snode
}
virtualContainer: VirtualContainer {
-virtualNodes -> vnode
}
snode: SubstrateResourceNode
vnode: VirtualResourceNode {
++ -host -> snode
}
# vnode.resourceDemand <= snode.resourceAmountAvailable
# snode.resourceAmountAvailable >= 0
}
//
// GIPSL starts here!
//
mapping n2n with mapVnode {
var v : EInt
};
constraint -> class::VirtualResourceNode {
mappings.n2n->filter(m | m.nodes().vnode == self)->count() == 1
}
constraint -> mapping::n2n {
self.variables().v >= 0
& self.variables().v <= 1337
}
objective n2nObj -> mapping::n2n {
1
}
objective vObj -> mapping::n2n {
self.variables().v
}
global objective : max {
n2nObj + vObj
}