public class BoundingBoxMetric
extends java.lang.Object
Constructor and Description |
---|
BoundingBoxMetric(java.util.List<PlacementFrame.PlacementNode> allNodes,
java.util.List<PlacementFrame.PlacementNetwork> allNetworks,
SimulatedAnnealing.IncrementalState finalState)
Method to create the metric.
|
Modifier and Type | Method and Description |
---|---|
protected double |
calculateBoundingBoxScore(PlacementFrame.PlacementNetwork n)
Method to compute the bounding box score for a given network.
|
double |
getCurrentScore()
Get current score.
|
double |
getNetworkScoreForNode(PlacementFrame.PlacementNode n)
Returns the metric's score for all
PlacementNetwork s that the
given PlacementNode belongs to. |
double |
getScoreForNetwork(PlacementFrame.PlacementNetwork n)
Gets the Bounding Box Score for the given
PlacementNetwork |
double |
init(java.util.List<PlacementFrame.PlacementNetwork> allNetworks)
This initialises this metric.
|
double |
update(int index)
Updates the metric score.
|
public BoundingBoxMetric(java.util.List<PlacementFrame.PlacementNode> allNodes, java.util.List<PlacementFrame.PlacementNetwork> allNetworks, SimulatedAnnealing.IncrementalState finalState)
allNodes
- a list containing all PlacementNode
objects.allNetworks
- a list of all PlacementNetwork
objects between the nodes.finalState
- an IncremetntalState
object describing the current state.public double init(java.util.List<PlacementFrame.PlacementNetwork> allNetworks)
allNetworks
- a list of all PlacementNetwork
objects between the nodes.public double getCurrentScore()
public double getScoreForNetwork(PlacementFrame.PlacementNetwork n)
PlacementNetwork
n
- a PlacementNetwork
to get the score forPlacementNetwork
protected double calculateBoundingBoxScore(PlacementFrame.PlacementNetwork n)
n
- a PlacementNetwork
object for which the score is to be calculated.PlacementNetwork
.public double getNetworkScoreForNode(PlacementFrame.PlacementNode n)
PlacementNetwork
s that the
given PlacementNode
belongs to.n
- the given PlacementNode
public double update(int index)
index
- the index of the node that was moved or swapped.