Commit c4bd1697 authored by Sebastian Vollbrecht's avatar Sebastian Vollbrecht

Changed the access modifier of a utility method.

parent 3ff3253f
......@@ -406,13 +406,7 @@ public class InfeasibleMinIIProperty extends Property {
*/
if (!infeasibleCfg.getFixedNodes().contains(problematicNode)) {
Set<Integer> possibleLayers = placer.getPossibleLayers(problematicNode);
int chosenLayer = placer.placeNode(problematicNode, possibleLayers);
/*
* Now we have to pave the previous layers with zero nodes, so that our
* problematic node is going to end up in the same ASAP slot as the other
* problematic nodes.
*/
placer.placeZeroNodesInBetween(chosenLayer);
placer.placeNode(problematicNode, possibleLayers);
}
}
......
......@@ -43,31 +43,6 @@ public class InfeasibleNodePlacer implements Initializable {
this.infeasibleCfg = infeasibleCfg;
}
public int placeNode(ResourceNode problematicNode, Set<Integer> possibleLayers) {
boolean useCurrentLayer = possibleLayers.contains(infeasibleCfg.getLayers().getDepth(problematicNode.getId()));
/*
* Determine the problematic node's target layer, based on our previous
* findings. Also move the node to its target layer if needed.
*/
int targetLayer;
if (!useCurrentLayer) {
targetLayer = JavaUtils.pickRandomElement(possibleLayers, rng);
} else {
targetLayer = infeasibleCfg.getLayers().getDepth(problematicNode.getId());
}
if (!useCurrentLayer) {
moveNodeToLayer(problematicNode, targetLayer);
}
infeasibleCfg.fixateNode(problematicNode);
return targetLayer;
}
public Set<Integer> getPossibleLayers(ResourceNode problematicNode) {
int remainingZeroNodes = infeasibleCfg.getRemainingZeroNodes().size();
......@@ -170,7 +145,37 @@ public class InfeasibleNodePlacer implements Initializable {
}
public void placeZeroNodesInBetween(int targetLayer) {
public void placeNode(ResourceNode problematicNode, Set<Integer> possibleLayers) {
boolean useCurrentLayer = possibleLayers.contains(infeasibleCfg.getLayers().getDepth(problematicNode.getId()));
/*
* Determine the problematic node's target layer, based on our previous
* findings. Also move the node to its target layer if needed.
*/
int targetLayer;
if (!useCurrentLayer) {
targetLayer = JavaUtils.pickRandomElement(possibleLayers, rng);
} else {
targetLayer = infeasibleCfg.getLayers().getDepth(problematicNode.getId());
}
if (!useCurrentLayer) {
moveNodeToLayer(problematicNode, targetLayer);
}
infeasibleCfg.fixateNode(problematicNode);
/*
* Now we have to pave the previous layers with zero nodes, so that our
* problematic node is guaranteed the possibility to end up in the same
* ASAP slot as the other problematic nodes.
*/
placeZeroNodesInBetween(targetLayer);
}
private void placeZeroNodesInBetween(int targetLayer) {
int firstLayer = startCfg.getDestinationNodeLayer() + 1;
......
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