Commit 9f69f048 authored by Sebastian Vollbrecht's avatar Sebastian Vollbrecht

Moved two files to more appropriate locations.

parent 624d1609
/*
* Copyright 2018 Sebastian Vollbrecht, Julian Oppermann
* Embedded Systems and Applications Group, TU Darmstadt
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package graphgen.generator.components.properties.minII;
import graphgen.datastructures.SeededRandom;
import graphgen.enums.EdgeValue;
import graphgen.enums.ModuloSchedulingFormulation;
import graphgen.generator.GraphGenerator;
import graphgen.generator.components.edges.EdgeCreator;
import graphgen.generator.components.edges.computers.ConstantValueComputer;
import graphgen.generator.components.edges.computers.DistributionValueComputer;
import graphgen.generator.components.edges.computers.IdenticalValueComputer;
import graphgen.generator.components.edges.includers.EdgeIncluder;
import graphgen.generator.components.edges.includers.IdenticalEdgeIncluder;
import graphgen.generator.components.edges.includers.ProbabilityEdgeIncluder;
import graphgen.generator.components.layers.FixedShapeLayerCreator;
import graphgen.generator.components.layers.IdenticalLayerCreator;
import graphgen.generator.components.layers.LayerCreator;
import graphgen.generator.components.layers.LayerStructureBuilder;
import graphgen.generator.components.layers.RandomShapeLayerCreator;
import graphgen.generator.components.nodes.DistributionNodeCreator;
import graphgen.generator.components.nodes.IdenticalNodeCreator;
import graphgen.generator.components.nodes.NodeCreator;
import graphgen.generator.components.properties.Property;
import graphgen.generator.components.properties.minII.feasible.FeasibleMinIIProperty;
import graphgen.generator.exceptions.MinIIImpossibleException;
import graphgen.generator.util.distribution.DeterministicDistribution;
import graphgen.generator.util.distribution.Distribution;
import graphgen.generator.util.distribution.OccurrenceDistribution;
import graphgen.generator.util.distribution.ProbabilityDistribution;
import graphgen.graph.Graph;
import graphgen.graph.NamedGraph;
import graphgen.graph.Resource;
import graphgen.graph.ResourceNode;
import graphgen.lookuptables.LookupTables;
import graphgen.util.DistributionUtils;
import graphgen.util.SchedulingUtils;
import graphgen.util.TestUtils;
import modsched.Edge;
import modsched.Schedule;
import org.junit.Test;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import static org.junit.Assert.fail;
public class FeasibleMinIIPropertyTest {
@Test
public void fail_ResMinIITooBig() {
int n = 10;
int l = 5;
int minII = 5;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(0.45);
EdgeIncluder backedgeIncluder = new ProbabilityEdgeIncluder(0.05);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1), new ConstantValueComputer(1),
new ConstantValueComputer(1)
);
Resource[] resources = {new Resource("multiplier", 2, 1)};
int[] occurrences = {10};
Distribution<Resource> resDist = new OccurrenceDistribution<>(resources, occurrences);
NodeCreator nc = new DistributionNodeCreator(resDist);
int[] nodesPerLayer = DistributionUtils.nodesPerLayerDistribution(n, l, new SeededRandom(42));
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, backedgeIncluder, property);
try {
gg.createGraph(42);
fail("This call should have thrown an exception!");
} catch (MinIIImpossibleException expected) {
}
}
@Test
public void pass_AllLimited_NoBackedge() {
int minII = 5;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(1);
EdgeIncluder backedgeIncluder = new ProbabilityEdgeIncluder(0.75);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1), new ConstantValueComputer(1),
new ConstantValueComputer(1)
);
Resource add = new Resource("adder", 0, 2);
int startingID = GraphGenerator.SINK.getId() + 1;
Set<ResourceNode> nodes = new HashSet<>();
for (int nodeCount = 0; nodeCount < 10; nodeCount++) {
int nodeID = nodeCount + startingID;
nodes.add(new ResourceNode(nodeID, add));
}
NodeCreator nc = new IdenticalNodeCreator(nodes);
int[] nodesPerLayer = {1, 2, 4, 2, 1};
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, backedgeIncluder, property);
assertMinII(gg, 42, minII, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_AllLimited_WithBackedge() {
int minII = 10;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(1);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1),
new DistributionValueComputer(new DeterministicDistribution<>(0, 1)),
new DistributionValueComputer(new DeterministicDistribution<>(1, 2))
);
Resource add = new Resource("adder", 0, 2);
Set<ResourceNode> nodes = new HashSet<>();
int startingID = GraphGenerator.SINK.getId() + 1;
for (int nodeCount = 0; nodeCount < 10; nodeCount++) {
int nodeID = nodeCount + startingID;
nodes.add(new ResourceNode(nodeID, add));
}
NodeCreator nc = new IdenticalNodeCreator(nodes);
int[] nodesPerLayer = {1, 2, 4, 2, 1};
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, edgeIncluder, property);
assertMinII(gg, 42, minII, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_NotAllLimited_WithBackedge() {
int minII = 5;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(1);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1), new ConstantValueComputer(1),
new ConstantValueComputer(1)
);
int[] nodesPerLayer = {1, 2, 1};
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
Resource add = new Resource("adder", 1, 2);
Resource unl = new Resource("unlimited", 0);
Set<ResourceNode> nodes = new HashSet<>();
int startingID = GraphGenerator.SINK.getId() + 1;
for (int nodeCount = 0; nodeCount < Arrays.stream(nodesPerLayer).sum(); nodeCount++) {
int nodeID = nodeCount + startingID;
nodes.add(new ResourceNode(nodeID, nodeID % 2 == 0 ? add : unl));
}
NodeCreator nc = new IdenticalNodeCreator(nodes);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, edgeIncluder, property);
assertMinII(gg, 42, minII, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_NotAllLimited_WithBackedge2() {
int minII = 8;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(1);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1), new ConstantValueComputer(1),
new ConstantValueComputer(1)
);
int[] nodesPerLayer = {1, 2, 4, 2, 1};
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
Resource add = new Resource("adder", 1, 2);
Resource unl = new Resource("unlimited", 0);
Set<ResourceNode> nodes = new HashSet<>();
int startingID = GraphGenerator.SINK.getId() + 1;
for (int nodeCount = 0; nodeCount < Arrays.stream(nodesPerLayer).sum(); nodeCount++) {
int nodeID = nodeCount + startingID;
nodes.add(new ResourceNode(nodeID, nodeID % 2 == 0 ? add : unl));
}
NodeCreator nc = new IdenticalNodeCreator(nodes);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, edgeIncluder, property);
long seed = -7576922639431782545L;
assertMinII(gg, seed, minII, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_NotAllLimited_WithBackedge3() {
int minII = 6;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(1);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1), new ConstantValueComputer(1),
new ConstantValueComputer(1)
);
int[] nodesPerLayer = {1, 2, 4, 2, 1};
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
Resource add = new Resource("adder", 1, 2);
Resource unl = new Resource("unlimited", 0);
Set<ResourceNode> nodes = new HashSet<>();
int startingID = GraphGenerator.SINK.getId() + 1;
for (int nodeCount = 0; nodeCount < Arrays.stream(nodesPerLayer).sum(); nodeCount++) {
int nodeID = nodeCount + startingID;
nodes.add(new ResourceNode(nodeID, nodeID % 2 == 0 ? add : unl));
}
NodeCreator nc = new IdenticalNodeCreator(nodes);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, edgeIncluder, property);
assertMinII(gg, 42, minII, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_NotAllLimited_WithBackedge_RidiculousMinII() {
int minII = 80;
Property property = new FeasibleMinIIProperty(minII, 1, 1, ModuloSchedulingFormulation.MOOVAC);
EdgeIncluder edgeIncluder = new ProbabilityEdgeIncluder(1);
EdgeCreator ec = new EdgeCreator(new ConstantValueComputer(1), new ConstantValueComputer(1),
new ConstantValueComputer(1)
);
int[] nodesPerLayer = {1, 2, 4, 2, 1};
LayerCreator np = new FixedShapeLayerCreator(nodesPerLayer);
Resource add = new Resource("adder", 1, 2);
Resource unl = new Resource("unlimited", 0);
Set<ResourceNode> nodes = new HashSet<>();
int startingID = GraphGenerator.SINK.getId() + 1;
for (int nodeCount = 0; nodeCount < Arrays.stream(nodesPerLayer).sum(); nodeCount++) {
int nodeID = nodeCount + startingID;
nodes.add(new ResourceNode(nodeID, nodeID % 2 == 0 ? add : unl));
}
NodeCreator nc = new IdenticalNodeCreator(nodes);
GraphGenerator gg = new GraphGenerator(np, nc, ec, edgeIncluder, edgeIncluder, property);
assertMinII(gg, 42, minII, ModuloSchedulingFormulation.MOOVAC);
}
@Test
public void pass_CongruenceClassDisallowsConnection() {
Resource add = new Resource("adder", 1, 2);
Resource unl = new Resource("unlimited", 0);
int id = GraphGenerator.SINK.getId() + 1;
ResourceNode n_0 = new ResourceNode(id++, unl);
ResourceNode n_1 = new ResourceNode(id++, add);
ResourceNode n_2 = new ResourceNode(id++, add);
ResourceNode n_3 = new ResourceNode(id++, add);
ResourceNode n_4 = new ResourceNode(id++, add);
ResourceNode n_5 = new ResourceNode(id++, add);
ResourceNode n_6 = new ResourceNode(id, unl);
Set<ResourceNode> nodes = new HashSet<>();
nodes.add(n_0);
nodes.add(n_1);
nodes.add(n_2);
nodes.add(n_3);
nodes.add(n_4);
nodes.add(n_5);
nodes.add(n_6);
NodeCreator nc = new IdenticalNodeCreator(nodes);
LayerStructureBuilder builder = new LayerStructureBuilder(4);
id = GraphGenerator.SINK.getId() + 1;
builder.addNode(0, id++);
builder.addNode(1, id++);
builder.addNode(1, id++);
builder.addNode(1, id++);
builder.addNode(2, id++);
builder.addNode(2, id++);
builder.addNode(3, id);
LayerCreator lc = new IdenticalLayerCreator(builder.build());
Set<Edge<ResourceNode>> edges = new HashSet<>();
edges.add(new Edge<>(n_0, n_1, 1, 0));
edges.add(new Edge<>(n_0, n_2, 1, 0));
edges.add(new Edge<>(n_0, n_3, 1, 0));
edges.add(new Edge<>(n_1, n_4, 1, 0));
edges.add(new Edge<>(n_2, n_5, 1, 0));
edges.add(new Edge<>(n_3, n_6, 1, 0));
edges.add(new Edge<>(n_4, n_6, 1, 0));
edges.add(new Edge<>(n_5, n_6, 1, 0));
edges.add(new Edge<>(n_3, n_4, 1, 0));
edges.add(new Edge<>(n_4, n_0, 1, 1));
IdenticalValueComputer edgeDelComp = new IdenticalValueComputer(EdgeValue.EDGE_DELAY, edges, LookupTables
.getDefaultEdgeValueDistribution(EdgeValue.EDGE_DELAY));
IdenticalValueComputer backedgeDelComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DELAY, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DELAY)
);
IdenticalValueComputer backedgeDisComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DISTANCE, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DISTANCE)
);
EdgeIncluder einc = new IdenticalEdgeIncluder(edges);
EdgeCreator ec = new EdgeCreator(edgeDelComp, backedgeDelComp, backedgeDisComp);
Property prop = new FeasibleMinIIProperty(5, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
GraphGenerator gg = new GraphGenerator(lc, nc, ec, einc, einc, prop);
long seed = 0;
assertMinII(gg, seed, 5, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_SlackInBetweenCycleNodes() {
Resource unl = new Resource("unlimited", 0);
Resource mul = new Resource("multiplier", 1, 1);
int id = GraphGenerator.SINK.getId() + 1;
ResourceNode n_0 = new ResourceNode(id++, unl);
ResourceNode n_1 = new ResourceNode(id++, unl);
ResourceNode n_2 = new ResourceNode(id++, unl);
ResourceNode n_3 = new ResourceNode(id++, mul);
ResourceNode n_4 = new ResourceNode(id++, mul);
ResourceNode n_5 = new ResourceNode(id++, mul);
ResourceNode n_6 = new ResourceNode(id, unl);
Set<ResourceNode> nodes = new HashSet<>();
nodes.add(n_0);
nodes.add(n_1);
nodes.add(n_2);
nodes.add(n_3);
nodes.add(n_4);
nodes.add(n_5);
nodes.add(n_6);
NodeCreator nc = new IdenticalNodeCreator(nodes);
LayerStructureBuilder builder = new LayerStructureBuilder(6);
id = GraphGenerator.SINK.getId() + 1;
builder.addNode(0, id++);
builder.addNode(1, id++);
builder.addNode(2, id++);
builder.addNode(3, id++);
builder.addNode(4, id++);
builder.addNode(1, id++);
builder.addNode(5, id);
LayerCreator lc = new IdenticalLayerCreator(builder.build());
Set<Edge<ResourceNode>> edges = new HashSet<>();
edges.add(new Edge<>(n_0, n_1, 1, 0));
edges.add(new Edge<>(n_1, n_2, 1, 0));
edges.add(new Edge<>(n_2, n_3, 1, 0));
edges.add(new Edge<>(n_3, n_4, 1, 0));
edges.add(new Edge<>(n_4, n_6, 1, 0));
edges.add(new Edge<>(n_0, n_5, 3, 0));
edges.add(new Edge<>(n_5, n_4, 1, 0));
edges.add(new Edge<>(n_4, n_2, 1, 1));
IdenticalValueComputer edgeDelComp = new IdenticalValueComputer(EdgeValue.EDGE_DELAY, edges, LookupTables
.getDefaultEdgeValueDistribution(EdgeValue.EDGE_DELAY));
IdenticalValueComputer backedgeDelComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DELAY, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DELAY)
);
IdenticalValueComputer backedgeDisComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DISTANCE, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DISTANCE)
);
EdgeIncluder einc = new IdenticalEdgeIncluder(edges);
EdgeCreator ec = new EdgeCreator(edgeDelComp, backedgeDelComp, backedgeDisComp);
Property prop = new FeasibleMinIIProperty(5, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
GraphGenerator gg = new GraphGenerator(lc, nc, ec, einc, einc, prop);
long seed = 4;
assertMinII(gg, seed, 5, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_SlackInBetweenCycleNodes2() {
Resource unl = new Resource("unlimited", 0);
Resource mul = new Resource("multiplier", 1, 1);
int id = GraphGenerator.SINK.getId() + 1;
ResourceNode n_0 = new ResourceNode(id++, unl);
ResourceNode n_1 = new ResourceNode(id++, unl);
ResourceNode n_2 = new ResourceNode(id++, unl);
ResourceNode n_3 = new ResourceNode(id++, mul);
ResourceNode n_4 = new ResourceNode(id++, mul);
ResourceNode n_5 = new ResourceNode(id++, mul);
ResourceNode n_6 = new ResourceNode(id, unl);
Set<ResourceNode> nodes = new HashSet<>();
nodes.add(n_0);
nodes.add(n_1);
nodes.add(n_2);
nodes.add(n_3);
nodes.add(n_4);
nodes.add(n_5);
nodes.add(n_6);
NodeCreator nc = new IdenticalNodeCreator(nodes);
LayerStructureBuilder builder = new LayerStructureBuilder(6);
id = GraphGenerator.SINK.getId() + 1;
builder.addNode(0, id++);
builder.addNode(1, id++);
builder.addNode(2, id++);
builder.addNode(3, id++);
builder.addNode(3, id++);
builder.addNode(4, id++);
builder.addNode(5, id);
LayerCreator lc = new IdenticalLayerCreator(builder.build());
Set<Edge<ResourceNode>> edges = new HashSet<>();
edges.add(new Edge<>(n_0, n_1, 1, 0));
edges.add(new Edge<>(n_1, n_2, 1, 0));
edges.add(new Edge<>(n_2, n_3, 1, 0));
edges.add(new Edge<>(n_3, n_4, 1, 0));
edges.add(new Edge<>(n_4, n_6, 1, 0));
edges.add(new Edge<>(n_0, n_5, 3, 0));
edges.add(new Edge<>(n_2, n_5, 1, 0));
edges.add(new Edge<>(n_5, n_4, 1, 0));
edges.add(new Edge<>(n_4, n_2, 1, 1));
edges.add(new Edge<>(n_5, n_0, 0, 1));
IdenticalValueComputer edgeDelComp = new IdenticalValueComputer(EdgeValue.EDGE_DELAY, edges, LookupTables
.getDefaultEdgeValueDistribution(EdgeValue.EDGE_DELAY));
IdenticalValueComputer backedgeDelComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DELAY, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DELAY)
);
IdenticalValueComputer backedgeDisComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DISTANCE, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DISTANCE)
);
EdgeIncluder einc = new IdenticalEdgeIncluder(edges);
EdgeCreator ec = new EdgeCreator(edgeDelComp, backedgeDelComp, backedgeDisComp);
Property prop = new FeasibleMinIIProperty(5, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
GraphGenerator gg = new GraphGenerator(lc, nc, ec, einc, einc, prop);
long seed = 5;
assertMinII(gg, seed, 5, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_SlackInBetweenCycleNodes3() {
Resource unl = new Resource("unlimited", 0);
Resource mul = new Resource("multiplier", 1, 1);
int id = GraphGenerator.SINK.getId() + 1;
ResourceNode n_0 = new ResourceNode(id++, unl);
ResourceNode n_1 = new ResourceNode(id++, unl);
ResourceNode n_2 = new ResourceNode(id++, unl);
ResourceNode n_3 = new ResourceNode(id++, mul);
ResourceNode n_4 = new ResourceNode(id++, mul);
ResourceNode n_5 = new ResourceNode(id++, mul);
ResourceNode n_6 = new ResourceNode(id, unl);
Set<ResourceNode> nodes = new HashSet<>();
nodes.add(n_0);
nodes.add(n_1);
nodes.add(n_2);
nodes.add(n_3);
nodes.add(n_4);
nodes.add(n_5);
nodes.add(n_6);
NodeCreator nc = new IdenticalNodeCreator(nodes);
LayerStructureBuilder builder = new LayerStructureBuilder(6);
id = GraphGenerator.SINK.getId() + 1;
builder.addNode(0, id++);
builder.addNode(1, id++);
builder.addNode(2, id++);
builder.addNode(3, id++);
builder.addNode(3, id++);
builder.addNode(4, id++);
builder.addNode(5, id);
LayerCreator lc = new IdenticalLayerCreator(builder.build());
Set<Edge<ResourceNode>> edges = new HashSet<>();
edges.add(new Edge<>(n_0, n_1, 1, 0));
edges.add(new Edge<>(n_1, n_2, 1, 0));
edges.add(new Edge<>(n_2, n_3, 1, 0));
edges.add(new Edge<>(n_3, n_4, 1, 0));
edges.add(new Edge<>(n_4, n_6, 1, 0));
edges.add(new Edge<>(n_0, n_5, 3, 0));
edges.add(new Edge<>(n_5, n_4, 1, 0));
edges.add(new Edge<>(n_2, n_5, 0, 0));
edges.add(new Edge<>(n_4, n_2, 1, 1));
edges.add(new Edge<>(n_5, n_0, 0, 1));
IdenticalValueComputer edgeDelComp = new IdenticalValueComputer(EdgeValue.EDGE_DELAY, edges, LookupTables
.getDefaultEdgeValueDistribution(EdgeValue.EDGE_DELAY));
IdenticalValueComputer backedgeDelComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DELAY, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DELAY)
);
IdenticalValueComputer backedgeDisComp = new IdenticalValueComputer(EdgeValue.BACKEDGE_DISTANCE, edges,
LookupTables
.getDefaultEdgeValueDistribution(
EdgeValue.BACKEDGE_DISTANCE)
);
EdgeIncluder einc = new IdenticalEdgeIncluder(edges);
EdgeCreator ec = new EdgeCreator(edgeDelComp, backedgeDelComp, backedgeDisComp);
Property prop = new FeasibleMinIIProperty(5, 1, 1, ModuloSchedulingFormulation.EICHENBERGER);
GraphGenerator gg = new GraphGenerator(lc, nc, ec, einc, einc, prop);
long seed = 4;
assertMinII(gg, seed, 5, ModuloSchedulingFormulation.EICHENBERGER);
}
@Test
public void pass_SlackInBetweenCycleNodes4() {
Resource unl = new Resource("unlimited", 0);
Resource mul = new Resource("multiplier", 1, 1);
int id = GraphGenerator.SINK.getId() + 1;
ResourceNode n_0 = new ResourceNode(id++, unl);
ResourceNode n_1 = new ResourceNode(id++, unl);
ResourceNode n_2 = new ResourceNode(id++, unl);
ResourceNode n_3 = new ResourceNode(id++, mul);
ResourceNode n_4 = new ResourceNode(id++, mul);
ResourceNode n_5 = new ResourceNode(id++, mul);
ResourceNode n_6 = new ResourceNode(id, unl);
Set<ResourceNode> nodes = new HashSet<>();
nodes.add(n_0);
nodes.add(n_1);
nodes.add(n_2);
nodes.add(n_3);
nodes.add(n_4);
nodes.add(n_5);
nodes.add(n_6);