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 TypeMethodDescriptionvoid
Clone the current solution.void
void
ConstructGreedyA
(int greedy, double alpha) void
ConstructGreedyB
(int greedy, double alpha) void
ConstructGreedyC
(int greedy, double alpha) void
ConstructRandom
(int c) int
DeltaExchange
(int f, int g, int xfp, int xgp) boolean
void
Evaluate()
int
EvaluateAdd
(int f, int k) int
EvaluateDrop
(int f) int
EvaluateExchangeDiff
(int i, int j, int k, int l) int
EvaluateExchangeSame
(int i, int j, int l) int
EvaluateGreedy
(int u, int i) int
int
EvaluateSwap
(int i, int j) void
Exchange
(int i, int j, int k, int l) boolean
boolean
ExploreExchange
(int strategy) boolean
boolean
boolean
ExploreExchangeInc
(int strategy) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
ExploreInsert
(int strategy) boolean
boolean
boolean
ExploreInsertInc
(int strategy) boolean
boolean
int
getGreedyA1
(List<Integer> FL, int i, double alpha) int
getGreedyA2
(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()
double
getScore()
Get the current solution score.int
hashCode()
void
Insert
(int i, int j, int k, int l) double
Recalculate solution score from scratch, using the problem objective function.void
Shake
(int ks) void
Shake1
(int ks, int move) void
Shake2
(int ks, int move) void
Shake3
(int ks, int move) void
Shake4
(int ks, int move) void
Shake5
(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:Solution
Clone the current solution. Deep clone mutable data or you will regret it.- Specified by:
cloneSolution
in 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:
toString
in 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()
-