Module es.upm.fi.cig.multictbnc
Class CTBNTabuSearchIndividual
java.lang.Object
es.upm.fi.cig.multictbnc.learning.structure.optimisation.hillclimbing.implementation.CTBNHillClimbingIndividual
es.upm.fi.cig.multictbnc.learning.structure.optimisation.tabusearch.CTBNTabuSearchIndividual
- All Implemented Interfaces:
HillClimbingImplementation
Implements the tabu search algorithm for continuous-time Bayesian networks. It finds the parent set for a single
node, so it can be used to find the structure of a continuous-time Bayesian network in parallel.
-
Constructor Summary
ConstructorDescriptionCTBNTabuSearchIndividual
(CTBNScoreFunction scoreFunction, int tabuListSize, int maxNumNotImprovements) Initialises the tabu search algorithm by proving a score function and a tabu list size. -
Method Summary
Modifier and TypeMethodDescriptionprotected HillClimbingSolution
findBestNeighbor
(CTBN<? extends Node> ctbn, int idxNode, boolean[][] adjacencyMatrix, Map<Long, Double> cache) Finds the best neighbour for a CTBN node.protected boolean[][]
findStructureNode
(CTBN<? extends Node> ctbn, int idxNode, boolean[][] adjacencyMatrix) Optimises the function score to find the parent set of a given node.Returns a unique identifier for the hill climbing-based algorithm.Returns the parameters that are used by the hill climbing implementation.Methods inherited from class es.upm.fi.cig.multictbnc.learning.structure.optimisation.hillclimbing.implementation.CTBNHillClimbingIndividual
computeScore, findStructure, findStructure, findStructure, getInfoScoreFunction, increaseNumEdgesTested
-
Constructor Details
-
CTBNTabuSearchIndividual
public CTBNTabuSearchIndividual(CTBNScoreFunction scoreFunction, int tabuListSize, int maxNumNotImprovements) Initialises the tabu search algorithm by proving a score function and a tabu list size.- Parameters:
scoreFunction
- score functiontabuListSize
- tabu list sizemaxNumNotImprovements
- maximum number of iterations to continue without improvements in the score before stopping the search
-
-
Method Details
-
getIdentifier
Description copied from interface:HillClimbingImplementation
Returns a unique identifier for the hill climbing-based algorithm.- Specified by:
getIdentifier
in interfaceHillClimbingImplementation
- Overrides:
getIdentifier
in classCTBNHillClimbingIndividual
- Returns:
- unique identifier for the hill climbing-based algorithm
-
getParametersAlgorithm
Description copied from interface:HillClimbingImplementation
Returns the parameters that are used by the hill climbing implementation.- Specified by:
getParametersAlgorithm
in interfaceHillClimbingImplementation
- Overrides:
getParametersAlgorithm
in classCTBNHillClimbingIndividual
- Returns:
- a
Map
with the parameters used by the algorithm
-
findBestNeighbor
protected HillClimbingSolution findBestNeighbor(CTBN<? extends Node> ctbn, int idxNode, boolean[][] adjacencyMatrix, Map<Long, Double> cache) Description copied from class:CTBNHillClimbingIndividual
Finds the best neighbour for a CTBN node.- Overrides:
findBestNeighbor
in classCTBNHillClimbingIndividual
- Parameters:
ctbn
- continuous-time Bayesian network that contains the nodeidxNode
- node indexadjacencyMatrix
- current adjacency matrixcache
- cache used to avoid recomputing scores- Returns:
- a
HillClimbingSolution
with the adjacency matrix and score of the best neighbour
-
findStructureNode
protected boolean[][] findStructureNode(CTBN<? extends Node> ctbn, int idxNode, boolean[][] adjacencyMatrix) Description copied from class:CTBNHillClimbingIndividual
Optimises the function score to find the parent set of a given node.- Overrides:
findStructureNode
in classCTBNHillClimbingIndividual
- Parameters:
ctbn
- continuous-time Bayesian network that contains the nodeidxNode
- index of the nodeadjacencyMatrix
- current adjacency matrix- Returns:
- adjacency matrix that includes the best parent set of the node that was found
-