Module es.upm.fi.cig.multictbnc
Class HillClimbingSolution
java.lang.Object
es.upm.fi.cig.multictbnc.learning.structure.optimisation.hillclimbing.HillClimbingSolution
Class used to contain the solution given by the hill climbing algorithms. This includes the adjacency matrix of the
found structure and its score.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean[][]
Returns the adjacency matrix of the structure.int[][]
Returns the last arc modified.double
getScore()
Returns the score of the structure found.void
setAdjacencyMatrix
(boolean[][] adjacencyMatrix) Sets the adjacency matrix of the structure.void
setArcModified
(int idxParent, int idxChild, int idxOperation) Define the last arc that was modified.void
setScore
(double score) Sets the score of the structure found.
-
Constructor Details
-
HillClimbingSolution
public HillClimbingSolution()
-
-
Method Details
-
getAdjacencyMatrix
public boolean[][] getAdjacencyMatrix()Returns the adjacency matrix of the structure.- Returns:
- adjacency matrix of the structure
-
getModifiedArcs
public int[][] getModifiedArcs()Returns the last arc modified.- Returns:
int[][]
with the first dimension referring to the index of the operation applied to the arc and the second dimension being of size two and representing the modified arc. The first position is for the parent node index and the second for the child.
-
getScore
public double getScore()Returns the score of the structure found.- Returns:
- score of the found structure
-
setAdjacencyMatrix
public void setAdjacencyMatrix(boolean[][] adjacencyMatrix) Sets the adjacency matrix of the structure.- Parameters:
adjacencyMatrix
- adjacency matrix of the structure
-
setArcModified
public void setArcModified(int idxParent, int idxChild, int idxOperation) Define the last arc that was modified.- Parameters:
idxParent
- index of the parent nodeidxChild
- index of the child nodeidxOperation
- index of the operation performed
-
setScore
public void setScore(double score) Sets the score of the structure found.- Parameters:
score
- score of the structure found
-