massim.competition2012.scenario
Class GraphGeneratorTriangulationBalanced

java.lang.Object
  extended by massim.competition2012.scenario.GraphGenerator
      extended by massim.competition2012.scenario.GraphGeneratorTriangulationBalanced
All Implemented Interfaces:
java.io.Serializable

public class GraphGeneratorTriangulationBalanced
extends GraphGenerator
implements java.io.Serializable

This class is a graph generation that uses an imperfect triangulation algorithm over a grid, with an ad-hoc Heuristic to improve performance when generating big maps.

See Also:
Serialized Form

Constructor Summary
GraphGeneratorTriangulationBalanced()
           
 
Method Summary
 void generate(java.util.Vector<GraphNode> nodes, java.util.Vector<GraphEdge> edges, int nodesNum, int gridWidth, int gridHeight, int cellWidth, int minNodeWeight, int maxNodeWeight, int minEdgeCost, int maxEdgeCost, java.util.Random random, int randomWeight, int gradientWeight, int optimaWeight, int blurIterations, int optimaPercentage)
          Generates a graph.
 java.util.HashMap<GraphNode,GraphNode> getCounterparts()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphGeneratorTriangulationBalanced

public GraphGeneratorTriangulationBalanced()
Method Detail

generate

public void generate(java.util.Vector<GraphNode> nodes,
                     java.util.Vector<GraphEdge> edges,
                     int nodesNum,
                     int gridWidth,
                     int gridHeight,
                     int cellWidth,
                     int minNodeWeight,
                     int maxNodeWeight,
                     int minEdgeCost,
                     int maxEdgeCost,
                     java.util.Random random,
                     int randomWeight,
                     int gradientWeight,
                     int optimaWeight,
                     int blurIterations,
                     int optimaPercentage)
Description copied from class: GraphGenerator
Generates a graph.

Specified by:
generate in class GraphGenerator
Parameters:
nodes - an empty Vector<GraphNode> where the nodes of the new graph shall be added.
edges - an empty Vector<GraphEdge> where the edges of the new graph shall be added.
nodesNum - Number of node that the generated graph will have.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCounterparts

public java.util.HashMap<GraphNode,GraphNode> getCounterparts()


Copyright © 2012. All Rights Reserved.