public class HelpFunctions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAXZONECONNECTION |
static int |
unexploredEdgeWeight |
Constructor and Description |
---|
HelpFunctions() |
Modifier and Type | Method and Description |
---|---|
LinkedList<String> |
ConnectionsOutOfZone(String checkedVertex,
LinkedList<String> allowedVertices,
LinkedList<apltk.interpreter.data.LogicBelief> edges) |
ArrayList<apltk.interpreter.data.LogicGoal> |
findRoute(String position,
LinkedList<String> destination,
LinkedList<String> vertices,
LinkedList<apltk.interpreter.data.LogicBelief> edges,
boolean useEdgeWeight,
int MAXSEARCH) |
LinkedList<String> |
findZone(int borderSizeMAX,
int MAXZONESIZE,
String startVertexName,
LinkedList<apltk.interpreter.data.LogicBelief> vertices,
LinkedList<apltk.interpreter.data.LogicBelief> edges) |
int |
getAgentID(String agentName)
extracts the agents ID out of his name
precondition: agentName := 'name' + 'ID', |name|>0
|
int |
getEdgeWeight(LinkedList<apltk.interpreter.data.LogicBelief> edges,
LinkedList<String> verticesByName,
String origin,
String destination,
boolean useEdgeWeight) |
static int |
getMin(int[] distance,
boolean[] isReady,
int dim) |
apltk.interpreter.data.LogicBelief |
goalToBelief(apltk.interpreter.data.LogicGoal goal)
Maps a goal to a belief.
|
boolean |
isInt(String i) |
public static final int unexploredEdgeWeight
public static final int MAXZONECONNECTION
public ArrayList<apltk.interpreter.data.LogicGoal> findRoute(String position, LinkedList<String> destination, LinkedList<String> vertices, LinkedList<apltk.interpreter.data.LogicBelief> edges, boolean useEdgeWeight, int MAXSEARCH)
current
- position, all posible destinations, all edges known to the
agent, all vertices known to the agent
useEdgeWeight=1 means, that the algorihm take
account of the edge weight calculation shortes paths
useEdgeWeight=0 mean, that the length of a path
is determined by the number of edges used,
maximum number of serach stepstodo*
public static int getMin(int[] distance, boolean[] isReady, int dim)
dimension
- of vertices arrayfindnextRoute()
public int getEdgeWeight(LinkedList<apltk.interpreter.data.LogicBelief> edges, LinkedList<String> verticesByName, String origin, String destination, boolean useEdgeWeight)
all
- edges known to the agent, 2 vertices which supposedly form an
edgefindnextRoute()
public int getAgentID(String agentName)
name
- of the agent as StringsendMessagestoUnseenAgents
public boolean isInt(String i)
String
- to testgetAgentID
public LinkedList<String> findZone(int borderSizeMAX, int MAXZONESIZE, String startVertexName, LinkedList<apltk.interpreter.data.LogicBelief> vertices, LinkedList<apltk.interpreter.data.LogicBelief> edges)
max
- size of the zones border
max size of the zone itself (necessary to limit the search)
name of the vertex around which the zone is established,
edges and vertices of the map, topology informationinitialozeZone
public LinkedList<String> ConnectionsOutOfZone(String checkedVertex, LinkedList<String> allowedVertices, LinkedList<apltk.interpreter.data.LogicBelief> edges)
respective
- vertex, vertices not in the zone,
all edges of the mapfindZone
public apltk.interpreter.data.LogicBelief goalToBelief(apltk.interpreter.data.LogicGoal goal)
goal
- Copyright © 2013. All Rights Reserved.