Class CAPSolution

java.lang.Object
es.urjc.etsii.grafo.solution.Solution<CAPSolution,CAPInstance>
es.urjc.etsii.grafo.flayouts.model.CAPSolution

public class CAPSolution extends Solution<CAPSolution,CAPInstance>
  • Constructor Details

    • CAPSolution

      public CAPSolution(CAPInstance data)
      Initialize solution from instance
      Parameters:
      data -
    • CAPSolution

      public CAPSolution(CAPSolution s)
      Clone constructor
      Parameters:
      s - Solution to clone
  • Method Details

    • cloneSolution

      public CAPSolution cloneSolution()
      Description copied from class: Solution
      Clone the current solution. Deep clone mutable data or you will regret it.
      Specified by:
      cloneSolution in class Solution<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

      public String toString()
      Generate a string representation of this solution. Used when printing progress to console, show as minimal info as possible
      Specified by:
      toString in class Solution<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

      public boolean Explore(String ME)
    • 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

      public int getGreedyA1(List<Integer> FL, int i, double alpha)
    • getGreedyA2

      public int getGreedyA2(List<Integer> FL, int i, double alpha)
    • ConstructGreedyB

      public void ConstructGreedyB(int greedy, double alpha)
    • getGreedyB1

      public 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)
    • getGreedyB2

      public 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)
    • ConstructGreedyC

      public void ConstructGreedyC(int greedy, double alpha)
    • getGreedyC1

      public es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer,Integer> 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

      public es.urjc.etsii.grafo.flayouts.model.CAPSolution.pair<Integer,Integer> 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)
    • 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

      public List<Integer>[] getRho()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object