mas.agentsHempelsSofa.data.graph
Class Util

java.lang.Object
  extended by mas.agentsHempelsSofa.data.graph.Util

public class Util
extends java.lang.Object

An implementation of some utility methods which can be helpful for our graph.

Author:
Hempels-Sofa

Constructor Summary
Util()
           
 
Method Summary
static Edge generateRandomEdge(Graph graph, boolean surveyed)
          Generates a random edge
static Graph generateRandomGraph(int numberOfNodes, int numberOfEdges, boolean allSurveyed)
          Generates a random graph.
static java.util.LinkedList<AgentToken> genereateRandomTokens(int numberOfTokens, Graph g, java.lang.String team, java.lang.String state, java.lang.String role, int energy, int health, int strength, int visRange, int lastInspection)
          Generates tokens on graph g
static Edge getRandomEdge(Graph graph)
          Gets a random edge of a graph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

generateRandomGraph

public static Graph generateRandomGraph(int numberOfNodes,
                                        int numberOfEdges,
                                        boolean allSurveyed)
Generates a random graph.

Parameters:
numberOfNodes - the number of nodes to generate
numberOfEdges - the number of edges to generate
Returns:
a random graph

generateRandomEdge

public static Edge generateRandomEdge(Graph graph,
                                      boolean surveyed)
Generates a random edge

Parameters:
graph - the graph the edge shall be created from
Returns:
the edge

getRandomEdge

public static Edge getRandomEdge(Graph graph)
Gets a random edge of a graph

Parameters:
graph - the graph the edge shall be picked from
Returns:
the edge

genereateRandomTokens

public static java.util.LinkedList<AgentToken> genereateRandomTokens(int numberOfTokens,
                                                                     Graph g,
                                                                     java.lang.String team,
                                                                     java.lang.String state,
                                                                     java.lang.String role,
                                                                     int energy,
                                                                     int health,
                                                                     int strength,
                                                                     int visRange,
                                                                     int lastInspection)
Generates tokens on graph g

Parameters:
numberOfTokens - number of tokens to be generated
g - the graph on which the tokens will be placed
team - the Team to which the tokens belong
state - the state of the generated tokens
role - the role of the generated tokens


Copyright © 2012. All Rights Reserved.