Class CAPSolution
java.lang.Object
es.urjc.etsii.grafo.solution.Solution<CAPSolution,CAPInstance>
es.urjc.etsii.grafo.flayouts.model.CAPSolution
-
Field Summary
Fields inherited from class es.urjc.etsii.grafo.solution.Solution
lastModifiedTime, lastMoves -
Constructor Summary
ConstructorsConstructorDescriptionCAPSolution(CAPInstance data) Initialize solution from instanceClone constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidClone the current solution.voidvoidConstructGreedyA(int greedy, double alpha) voidConstructGreedyB(int greedy, double alpha) voidConstructGreedyC(int greedy, double alpha) voidConstructRandom(int c) intDeltaExchange(int f, int g, int xfp, int xgp) booleanvoidEvaluate()intEvaluateAdd(int f, int k) intEvaluateDrop(int f) intEvaluateExchangeDiff(int i, int j, int k, int l) intEvaluateExchangeSame(int i, int j, int l) intEvaluateGreedy(int u, int i) intintEvaluateSwap(int i, int j) voidExchange(int i, int j, int k, int l) booleanbooleanExploreExchange(int strategy) booleanbooleanbooleanExploreExchangeInc(int strategy) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanExploreInsert(int strategy) booleanbooleanbooleanExploreInsertInc(int strategy) booleanbooleanintgetGreedyA1(List<Integer> FL, int i, double alpha) intgetGreedyA2(List<Integer> FL, int i, double alpha) es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, Integer>> getGreedyB1(List<Integer> CL, double alpha) es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, Integer>> getGreedyB2(List<Integer> CL, double alpha) getGreedyC1(ArrayList<es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, Integer>>> CL, int u, double alpha) getGreedyC2(ArrayList<es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer, Integer>>> CL, int u, double alpha) getRho()doublegetScore()Get the current solution score.inthashCode()voidInsert(int i, int j, int k, int l) doubleRecalculate solution score from scratch, using the problem objective function.voidShake(int ks) voidShake1(int ks, int move) voidShake2(int ks, int move) voidShake3(int ks, int move) voidShake4(int ks, int move) voidShake5(int ks, int move) toString()Generate a string representation of this solution.Methods inherited from class es.urjc.etsii.grafo.solution.Solution
customProperties, getInstance, getLastModifiedTime, getVersion, lastExecutesMoves, lastExecutesMovesAsString, notifyUpdate, notifyUpdate
-
Constructor Details
-
CAPSolution
Initialize solution from instance- Parameters:
data-
-
CAPSolution
Clone constructor- Parameters:
s- Solution to clone
-
-
Method Details
-
cloneSolution
Description copied from class:SolutionClone the current solution. Deep clone mutable data or you will regret it.- Specified by:
cloneSolutionin classSolution<CAPSolution,CAPInstance> - Returns:
- A deep clone of the current solution
-
getScore
public double getScore()Get the current solution score. The difference between this method and recalculateScore is that this result can be a property of the solution, or cached, it does not have to be calculated each time this method is called- Returns:
- current solution score as double
-
recalculateScore
public double recalculateScore()Recalculate solution score from scratch, using the problem objective function. The difference between this method and getScore is that we must recalculate the score from scratch, without using any cache/shortcuts. This method will be used to validate the correct behaviour of the getScore() method, and to help catch bugs or mistakes when changing incremental score calculation. DO NOT UPDATE CACHES IN THIS METHOD / MAKE SURE THIS METHOD DOES NOT HAVE SIDE EFFECTS DO NOT UPDATE CACHES IN THIS METHOD / MAKE SURE THIS METHOD DOES NOT HAVE SIDE EFFECTS and once more DO NOT UPDATE CACHES IN THIS METHOD / MAKE SURE THIS METHOD DOES NOT HAVE SIDE EFFECTS- Returns:
- current solution score as double
-
toString
Generate a string representation of this solution. Used when printing progress to console, show as minimal info as possible- Specified by:
toStringin classSolution<CAPSolution,CAPInstance> - Returns:
- Small string representing the current solution (Example: id + score)
-
Evaluate
public void Evaluate() -
EvaluateMove
public int EvaluateMove() -
CalculateCenters
public void CalculateCenters() -
Explore
-
Shake
public void Shake(int ks) -
ConstructRandom
public void ConstructRandom(int c) -
ConstructBalanced
public void ConstructBalanced() -
ConstructGreedyA
public void ConstructGreedyA(int greedy, double alpha) -
getGreedyA1
-
getGreedyA2
-
ConstructGreedyB
public void ConstructGreedyB(int greedy, double alpha) -
getGreedyB1
-
getGreedyB2
-
ConstructGreedyC
public void ConstructGreedyC(int greedy, double alpha) -
getGreedyC1
-
getGreedyC2
-
EvaluateGreedy
public int EvaluateGreedy(int u, int i) -
Exchange
public void Exchange(int i, int j, int k, int l) -
DeltaExchange
public int DeltaExchange(int f, int g, int xfp, int xgp) -
EvaluateExchangeSame
public int EvaluateExchangeSame(int i, int j, int l) -
EvaluateExchangeDiff
public int EvaluateExchangeDiff(int i, int j, int k, int l) -
ExploreExchange
public boolean ExploreExchange(int strategy) -
ExploreExchangeInc
public boolean ExploreExchangeInc(int strategy) -
ExploreExchangeHorizontalBest
public boolean ExploreExchangeHorizontalBest() -
ExploreExchangeHorizontalBestInc
public boolean ExploreExchangeHorizontalBestInc() -
ExploreExchangeVerticalBest
public boolean ExploreExchangeVerticalBest() -
ExploreExchangeVerticalBestInc
public boolean ExploreExchangeVerticalBestInc() -
ExploreExtendedBest
public boolean ExploreExtendedBest() -
ExploreExtendedBestBestInc
public boolean ExploreExtendedBestBestInc() -
ExploreExtendedBestHybridInc
public boolean ExploreExtendedBestHybridInc() -
ExploreExtendedBestFirstInc
public boolean ExploreExtendedBestFirstInc() -
ExploreExtendedHybridBestInc
public boolean ExploreExtendedHybridBestInc() -
ExploreExtendedHybridHybridInc
public boolean ExploreExtendedHybridHybridInc() -
ExploreExtendedHybridFirstInc
public boolean ExploreExtendedHybridFirstInc() -
ExploreExtendedFirstBestInc
public boolean ExploreExtendedFirstBestInc() -
ExploreExtendedFirstHybridInc
public boolean ExploreExtendedFirstHybridInc() -
ExploreExtendedFirstFirstInc
public boolean ExploreExtendedFirstFirstInc() -
Insert
public void Insert(int i, int j, int k, int l) -
EvaluateSwap
public int EvaluateSwap(int i, int j) -
EvaluateDrop
public int EvaluateDrop(int f) -
EvaluateAdd
public int EvaluateAdd(int f, int k) -
ExploreInsert
public boolean ExploreInsert(int strategy) -
ExploreInsertInc
public boolean ExploreInsertInc(int strategy) -
ExploreInsertHorizontalBest
public boolean ExploreInsertHorizontalBest() -
ExploreInsertHorizontalBestInc
public boolean ExploreInsertHorizontalBestInc() -
ExploreInsertVerticalBest
public boolean ExploreInsertVerticalBest() -
ExploreInsertVerticalBestInc
public boolean ExploreInsertVerticalBestInc() -
Shake1
public void Shake1(int ks, int move) -
Shake2
public void Shake2(int ks, int move) -
Shake3
public void Shake3(int ks, int move) -
Shake4
public void Shake4(int ks, int move) -
Shake5
public void Shake5(int ks, int move) -
getRho
-
equals
-
hashCode
public int hashCode()
-