Commit f102241f authored by Sebastian Vollbrecht's avatar Sebastian Vollbrecht

More code movements.

parent d2e0cbd7
......@@ -119,7 +119,4 @@ public abstract class Property implements Observer<Edge<ResourceNode>>, Initiali
this.rng = rng;
}
@Override
public abstract void reset();
}
......@@ -18,7 +18,6 @@
package graphgen.generator.components.properties.infeasibleMinII;
import graphgen.datastructures.SeededRandom;
import graphgen.generator.components.Initializable;
import graphgen.generator.components.properties.infeasibleMinII.configuration.InfeasibleConfiguration;
import graphgen.generator.components.properties.infeasibleMinII.configuration.StartConfiguration;
import graphgen.generator.components.properties.infeasibleMinII.configuration.SuffixConfiguration;
......@@ -40,19 +39,19 @@ import java.util.function.BiFunction;
import java.util.function.Predicate;
import java.util.stream.IntStream;
public class InfeasibleEdgePlanner implements Initializable {
public class InfeasibleEdgePlanner {
private final StartConfiguration startCfg;
private final InfeasibleConfiguration infeasibleCfg;
private final SuffixConfiguration suffixCfg;
private SeededRandom rng;
private final SeededRandom rng;
public InfeasibleEdgePlanner(StartConfiguration startCfg, InfeasibleConfiguration infeasibleCfg,
SuffixConfiguration suffixCfg) {
SuffixConfiguration suffixCfg, SeededRandom rng) {
this.startCfg = startCfg;
this.infeasibleCfg = infeasibleCfg;
this.suffixCfg = suffixCfg;
this.rng = rng;
}
public Set<Integer> getProblematicTimeslots() {
......@@ -382,16 +381,6 @@ public class InfeasibleEdgePlanner implements Initializable {
}
@Override
public void init(SeededRandom rng) {
this.rng = rng;
}
@Override
public void reset() {
// Do nothing.
}
public static Map<ResourceNode, PlannedEdge> getIncomingEdgesMap(Set<PlannedEdge> edges,
Collection<ResourceNode> relevantNodes) {
Map<ResourceNode, PlannedEdge> incomingEdgesByNode = new HashMap<>();
......
......@@ -18,7 +18,6 @@
package graphgen.generator.components.properties.infeasibleMinII;
import graphgen.datastructures.SeededRandom;
import graphgen.generator.components.Initializable;
import graphgen.generator.components.properties.infeasibleMinII.configuration.InfeasibleConfiguration;
import graphgen.generator.components.properties.infeasibleMinII.configuration.StartConfiguration;
import graphgen.graph.LayerStructure;
......@@ -31,21 +30,21 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
public class InfeasibleNodePlacer implements Initializable {
public class InfeasibleNodePlacer {
private final StartConfiguration startCfg;
private final InfeasibleConfiguration infeasibleCfg;
private final SeededRandom rng;
private SeededRandom rng;
public InfeasibleNodePlacer(StartConfiguration startCfg, InfeasibleConfiguration infeasibleCfg) {
public InfeasibleNodePlacer(StartConfiguration startCfg, InfeasibleConfiguration infeasibleCfg, SeededRandom rng) {
this.startCfg = startCfg;
this.infeasibleCfg = infeasibleCfg;
this.rng = rng;
}
public Set<Integer> getPossibleLayers(ResourceNode problematicNode) {
if (!infeasibleCfg.getProblematicNodes().contains(problematicNode)) {
if (!infeasibleCfg.getProblematicNodes().contains(Objects.requireNonNull(problematicNode))) {
throw new IllegalArgumentException("Node " + problematicNode + " is not problematic.");
} else if (infeasibleCfg.getFixedNodes().contains(problematicNode)) {
throw new IllegalArgumentException("Node " + problematicNode + " has been fixed already.");
......@@ -56,7 +55,7 @@ public class InfeasibleNodePlacer implements Initializable {
Set<Integer> possibleLayers = new HashSet<>();
LayerStructure layers = infeasibleCfg.getLayers();
if (Objects.requireNonNull(problematicNode).getDelay() == 0) {
if (problematicNode.getDelay() == 0) {
remainingZeroNodes--;
}
......@@ -155,10 +154,13 @@ public class InfeasibleNodePlacer implements Initializable {
if (possibleLayers.isEmpty()) {
throw new IllegalArgumentException("Possible layers must be non-empty.");
} else if (possibleLayers.stream().anyMatch(l -> l <= startCfg.getDestinationNodeLayer())) {
throw new IllegalArgumentException("Possible layers must be greater than the destination node's layer.");
} else if (!infeasibleCfg.getProblematicNodes().contains(problematicNode)) {
throw new IllegalArgumentException("Only problematic nodes must be placed in problematic spots.");
} else if (problematicNode != startCfg.getDestinationNode()) {
if (possibleLayers.stream().anyMatch(l -> l <= startCfg.getDestinationNodeLayer())) {
throw new IllegalArgumentException(
"Possible layers must be greater than the destination node's layer.");
} else if (!infeasibleCfg.getProblematicNodes().contains(problematicNode)) {
throw new IllegalArgumentException("Only problematic nodes must be placed in problematic spots.");
}
}
boolean useCurrentLayer = possibleLayers.contains(infeasibleCfg.getLayers().getDepth(problematicNode.getId()));
......@@ -226,16 +228,6 @@ public class InfeasibleNodePlacer implements Initializable {
}
}
@Override
public void init(SeededRandom rng) {
this.rng = rng;
}
@Override
public void reset() {
// Do nothing.
}
private void moveNodeToLayer(ResourceNode node, int layer) {
Set<Integer> swappableIDs = new HashSet<>();
......
......@@ -17,266 +17,21 @@
package graphgen.generator.components.properties.infeasibleMinII;
import graphgen.generator.components.properties.infeasibleMinII.configuration.InfeasibleConfiguration;
import graphgen.generator.components.properties.infeasibleMinII.configuration.StartConfiguration;
import graphgen.generator.exceptions.InfeasibilityImpossibleException;
import graphgen.graph.LayerStructure;
import graphgen.graph.Resource;
import graphgen.graph.ResourceNode;
import graphgen.util.JavaUtils;
import modsched.Node;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class InfeasibilityInspectorTest {
@Test
public void possibleLayers_ZeroDelay() {
Map<Integer, Integer> depthsByID = new HashMap<>();
depthsByID.put(2, 0);
depthsByID.put(3, 1);
depthsByID.put(4, 2);
depthsByID.put(5, 2);
depthsByID.put(6, 3);
depthsByID.put(7, 3);
depthsByID.put(8, 4);
LayerStructure layers = new LayerStructure(depthsByID);
Resource problematic = new Resource("problematic", 0, 3);
Resource unlimited = new Resource("unlimited", 0);
ResourceNode node2 = new ResourceNode(2, problematic);
ResourceNode node3 = new ResourceNode(3, unlimited);
ResourceNode node4 = new ResourceNode(4, unlimited);
ResourceNode node5 = new ResourceNode(5, unlimited);
ResourceNode node6 = new ResourceNode(6, problematic);
ResourceNode node7 = new ResourceNode(7, problematic);
ResourceNode node8 = new ResourceNode(8, problematic);
Set<ResourceNode> nodes = JavaUtils.asSet(node2, node3, node4, node5, node6, node7, node8);
Map<Integer, ResourceNode> nodeTable = nodes.stream().collect(Collectors.toMap(Node::getId, n -> n));
StartConfiguration startCfg = new StartConfiguration(layers, nodeTable, problematic, 0);
startCfg.setDestinationNode(node2);
startCfg.setDestinationNodeLayer(0);
InfeasibleConfiguration infeasibleCfg = new InfeasibleConfiguration(startCfg);
infeasibleCfg.addProblematicNode(node2);
infeasibleCfg.addProblematicNode(node6);
infeasibleCfg.addProblematicNode(node7);
infeasibleCfg.addProblematicNode(node8);
// Assume that node 2 is a problematic destination node.
infeasibleCfg.fixateNode(node2);
// Now try to place node 6 in different target layers.
InfeasibleNodePlacer placer = new InfeasibleNodePlacer(startCfg, infeasibleCfg);
assertEquals(JavaUtils.asSet(1, 2, 3, 4), placer.getPossibleLayers(node6));
// Now assume that node 6 has been fixed already - locking zero nodes 3 and 4 in place as well.
infeasibleCfg.fixateNode(node3);
infeasibleCfg.fixateNode(node4);
infeasibleCfg.fixateNode(node6);
assertEquals(JavaUtils.asSet(2, 3, 4), placer.getPossibleLayers(node7));
// Now assume that node 7 has been fixed as well (using zero nodes 3 and 4 as well).
infeasibleCfg.fixateNode(node7);
assertEquals(JavaUtils.asSet(2, 4), placer.getPossibleLayers(node8));
}
@Test
public void possibleLayers_NonZeroDelay_Possible() {
Map<Integer, Integer> depthsByID = new HashMap<>();
depthsByID.put(2, 0);
depthsByID.put(3, 1);
depthsByID.put(4, 2);
depthsByID.put(5, 2);
depthsByID.put(6, 3);
depthsByID.put(7, 3);
depthsByID.put(8, 4);
LayerStructure layers = new LayerStructure(depthsByID);
Resource problematic = new Resource("problematic", 1, 2);
Resource unlimited = new Resource("unlimited", 0);
ResourceNode node2 = new ResourceNode(2, problematic);
ResourceNode node3 = new ResourceNode(3, unlimited);
ResourceNode node4 = new ResourceNode(4, unlimited);
ResourceNode node5 = new ResourceNode(5, unlimited);
ResourceNode node6 = new ResourceNode(6, problematic);
ResourceNode node7 = new ResourceNode(7, problematic);
ResourceNode node8 = new ResourceNode(8, problematic);
Set<ResourceNode> nodes = JavaUtils.asSet(node2, node3, node4, node5, node6, node7, node8);
Map<Integer, ResourceNode> nodeTable = nodes.stream().collect(Collectors.toMap(Node::getId, n -> n));
StartConfiguration startCfg = new StartConfiguration(layers, nodeTable, problematic, 1);
startCfg.setDestinationNode(node3);
startCfg.setDestinationNodeLayer(0);
InfeasibleConfiguration infeasibleCfg = new InfeasibleConfiguration(startCfg);
infeasibleCfg.addProblematicNode(node2);
infeasibleCfg.addProblematicNode(node6);
infeasibleCfg.addProblematicNode(node7);
// Assume that node 3 is an unproblematic destination node.
infeasibleCfg.fixateNode(node3);
// Now try to place node 2 in different target layers.
InfeasibleNodePlacer placer = new InfeasibleNodePlacer(startCfg, infeasibleCfg);
assertEquals(JavaUtils.asSet(2, 3, 4), placer.getPossibleLayers(node2));
// Now assume that node 6 has been fixed again - locking zero node 4 in place as well.
infeasibleCfg.fixateNode(node4);
infeasibleCfg.fixateNode(node6);
assertEquals(JavaUtils.asSet(2, 3, 4), placer.getPossibleLayers(node2));
// Now assume that node 7 has been fixed as well in layer 2 (using zero/destination node 3).
layers.swapIDs(5, 7);
infeasibleCfg.fixateNode(node7);
assertEquals(JavaUtils.asSet(3, 4), placer.getPossibleLayers(node2));
}
@Test
public void possibleLayers_NonZeroDelay_Impossible() {
Map<Integer, Integer> depthsByID = new HashMap<>();
depthsByID.put(2, 0);
depthsByID.put(3, 1);
depthsByID.put(4, 2);
depthsByID.put(5, 2);
depthsByID.put(6, 3);
depthsByID.put(7, 3);
depthsByID.put(8, 4);
LayerStructure layers = new LayerStructure(depthsByID);
Resource problematic = new Resource("problematic", 1, 3);
Resource unlimited = new Resource("unlimited", 0);
ResourceNode node2 = new ResourceNode(2, problematic);
ResourceNode node3 = new ResourceNode(3, unlimited);
ResourceNode node4 = new ResourceNode(4, unlimited);
ResourceNode node5 = new ResourceNode(5, unlimited);
ResourceNode node6 = new ResourceNode(6, problematic);
ResourceNode node7 = new ResourceNode(7, problematic);
ResourceNode node8 = new ResourceNode(8, problematic);
Set<ResourceNode> nodes = JavaUtils.asSet(node2, node3, node4, node5, node6, node7, node8);
Map<Integer, ResourceNode> nodeTable = nodes.stream().collect(Collectors.toMap(Node::getId, n -> n));
StartConfiguration startCfg = new StartConfiguration(layers, nodeTable, problematic, 1);
startCfg.setDestinationNode(node3);
startCfg.setDestinationNodeLayer(0);
InfeasibleConfiguration infeasibleCfg = new InfeasibleConfiguration(startCfg);
infeasibleCfg.addProblematicNode(node2);
infeasibleCfg.addProblematicNode(node6);
infeasibleCfg.addProblematicNode(node7);
infeasibleCfg.addProblematicNode(node8);
// Assume that node 3 is an unproblematic destination node.
infeasibleCfg.fixateNode(node3);
// Now try to place node 2 in different target layers.
InfeasibleNodePlacer placer = new InfeasibleNodePlacer(startCfg, infeasibleCfg);
assertTrue(placer.getPossibleLayers(node2).isEmpty());
// Now assume that node 6 has been fixed again - locking zero node 4 in place as well.
infeasibleCfg.fixateNode(node4);
infeasibleCfg.fixateNode(node6);
assertTrue(placer.getPossibleLayers(node2).isEmpty());
// Now assume that node 7 has been fixed as well in layer 2 (using zero/destination node 3).
layers.swapIDs(5, 7);
infeasibleCfg.fixateNode(node7);
assertTrue(placer.getPossibleLayers(node2).isEmpty());
// Now assume that node 2 has been fixed as well in layer 3 (using zero node 4).
layers.swapIDs(2, 5);
infeasibleCfg.fixateNode(node2);
// Assert that node 8 cannot be placed in layer 4 anymore.
assertTrue(placer.getPossibleLayers(node8).isEmpty());
}
@Test
public void possibleLayers_BogusArguments() {
Map<Integer, Integer> depthsByID = new HashMap<>();
depthsByID.put(2, 0);
depthsByID.put(3, 1);
depthsByID.put(4, 2);
depthsByID.put(5, 2);
depthsByID.put(6, 3);
depthsByID.put(7, 3);
depthsByID.put(8, 4);
LayerStructure layers = new LayerStructure(depthsByID);
Resource problematic = new Resource("problematic", 0, 3);
Resource unlimited = new Resource("unlimited", 0);
ResourceNode node2 = new ResourceNode(2, problematic);
ResourceNode node3 = new ResourceNode(3, unlimited);
ResourceNode node4 = new ResourceNode(4, unlimited);
ResourceNode node5 = new ResourceNode(5, unlimited);
ResourceNode node6 = new ResourceNode(6, problematic);
ResourceNode node7 = new ResourceNode(7, problematic);
ResourceNode node8 = new ResourceNode(8, problematic);
Set<ResourceNode> nodes = JavaUtils.asSet(node2, node3, node4, node5, node6, node7, node8);
Map<Integer, ResourceNode> nodeTable = nodes.stream().collect(Collectors.toMap(Node::getId, n -> n));
StartConfiguration startCfg = new StartConfiguration(layers, nodeTable, problematic, 0);
startCfg.setDestinationNode(node2);
startCfg.setDestinationNodeLayer(0);
InfeasibleConfiguration infeasibleCfg = new InfeasibleConfiguration(startCfg);
infeasibleCfg.addProblematicNode(node2);
infeasibleCfg.addProblematicNode(node6);
infeasibleCfg.addProblematicNode(node7);
infeasibleCfg.addProblematicNode(node8);
// Assume that node 3 is a problematic destination node.
infeasibleCfg.fixateNode(node3);
InfeasibleNodePlacer placer = new InfeasibleNodePlacer(startCfg, infeasibleCfg);
try {
placer.getPossibleLayers(null);
fail("This call should have failed!");
} catch (NullPointerException expected) {
}
try {
placer.getPossibleLayers(node3);
fail("This call should have failed!");
} catch (IllegalArgumentException expected) {
}
}
@Test
public void problematicResources_Limits() {
Resource problematic1 = new Resource("problematic1", 0, 1);
......
......@@ -27,6 +27,7 @@ import graphgen.graph.Resource;
import graphgen.graph.ResourceNode;
import graphgen.util.JavaUtils;
import modsched.Node;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
......@@ -43,6 +44,13 @@ import static org.junit.Assert.assertTrue;
public class InfeasibleEdgePlannerTest {
private SeededRandom rng;
@Before
public void init() {
rng = new SeededRandom(42);
}
@Test
public void getProblematicTimeslots_ZeroDelay() {
......@@ -96,8 +104,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
// Calculate possible timeslots for the problematic nodes (relative to the destination node).
Set<Integer> timeslots = planner.getProblematicTimeslots();
......@@ -167,8 +174,9 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg,
new SeededRandom(42)
);
// Calculate possible timeslots for the problematic nodes (relative to the destination node).
Set<Integer> timeslots = planner.getProblematicTimeslots();
......@@ -230,8 +238,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
// The problematic timeslot cannot be anything else but 2.
assertEquals(JavaUtils.asSet(2), planner.getProblematicTimeslots());
......@@ -294,8 +301,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
// Calculate possible timeslots for the problematic nodes (relative to the destination node).
Set<Integer> timeslots = planner.getProblematicTimeslots();
......@@ -361,8 +367,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
// Calculate possible timeslots for the problematic nodes (relative to the destination node).
Set<Integer> timeslots = planner.getProblematicTimeslots();
......@@ -428,8 +433,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge3_5 = new PlannedEdge(node3, node5, 0, 0);
......@@ -500,8 +504,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge3_5 = new PlannedEdge(node3, node5, 0, 0);
......@@ -571,8 +574,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge4_6 = new PlannedEdge(node4, node6, 0, 0);
......@@ -638,8 +640,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge4_6 = new PlannedEdge(node4, node6, 0, 0);
......@@ -709,8 +710,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge3_5 = new PlannedEdge(node3, node5, 0, 0);
......@@ -786,8 +786,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge2_5 = new PlannedEdge(node2, node5, 0, 0);
PlannedEdge edge2_6 = new PlannedEdge(node2, node6, 0, 0);
......@@ -874,8 +873,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge4_6 = new PlannedEdge(node4, node6, 0, 0);
......@@ -953,8 +951,7 @@ public class InfeasibleEdgePlannerTest {
suffixNodes.forEach(suffixCfg::appendSuffixNode);
backedgeSources.forEach(suffixCfg::addBackedgeSource);
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg);
planner.init(new SeededRandom(42));
InfeasibleEdgePlanner planner = new InfeasibleEdgePlanner(startCfg, infeasibleCfg, suffixCfg, rng);
PlannedEdge edge3_4 = new PlannedEdge(node3, node4, 0, 0);
PlannedEdge edge4_6 = new PlannedEdge(node4, node6, 0, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment