mirror of
https://github.com/Echtzeitsysteme/gips-tests.git
synced 2024-06-02 18:31:59 +00:00
Maximilian Kratz
0c7e4eea2c
gipsl.all.build.model: EOpposite for host + guests and removes duplex edges in GIPSL specifications Removes duplex host edges in all other GIPSL projects
69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
package "gipsl.all.build.simple"
|
|
import "platform:/resource/gipsl.all.build.model/model/Model.ecore"
|
|
|
|
config {
|
|
solver := GLPK [home:="fu", license:="bar"];
|
|
launchConfig := true [main := "TODO"];
|
|
timeLimit := true [value := 42.0];
|
|
randomSeed := true [value := 73];
|
|
presolve := true;
|
|
debugOutput := true;
|
|
}
|
|
|
|
condition vnodeNotMapped = forbid vnodeIsMapped
|
|
pattern vnodeIsMapped {
|
|
host: SubstrateNode
|
|
|
|
vnode: VirtualNode {
|
|
-host -> host
|
|
}
|
|
}
|
|
|
|
pattern vnodeNotMapped {
|
|
vnode: VirtualNode
|
|
}
|
|
when vnodeNotMapped
|
|
|
|
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;
|
|
constraint -> class::SubstrateResourceNode {
|
|
mappings.n2n->filter(m | m.nodes().snode == self)->sum(m | m.nodes().vnode.resourceDemand) <= self.resourceAmountAvailable
|
|
}
|
|
constraint -> pattern::vnodeNotMapped {
|
|
mappings.n2n->filter(m | m.nodes().vnode == self.nodes().vnode)->count() == 1
|
|
}
|
|
|
|
objective nObj -> mapping::n2n {
|
|
1
|
|
}
|
|
|
|
global objective : min {
|
|
2 * nObj + 1
|
|
} |