cz.cuni.amis.pathfinding.map
Class IPFMapView.DefaultView<NODE>

Package class diagram package IPFMapView.DefaultView
java.lang.Object
  extended by cz.cuni.amis.pathfinding.map.IPFMapView.DefaultView<NODE>
All Implemented Interfaces:
IPFMapView<NODE>
Direct Known Subclasses:
IPFKnownMapView.DefaultView
Enclosing interface:
IPFMapView<NODE>

public static class IPFMapView.DefaultView<NODE>
extends Object
implements IPFMapView<NODE>

Default view does not impose any specific view on the map... all nodes/arcs are opened, no extra cost/nodes defined.

Author:
Jimmy

Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pathfinding.map.IPFMapView
IPFMapView.DefaultView<NODE>
 
Constructor Summary
IPFMapView.DefaultView()
           
 
Method Summary
 int getArcExtraCost(NODE nodeFrom, NODE nodeTo, int mapCost)
          Method defining extra-arc cost, that is a cost that is added to IPFMap.getArcCost(Object, Object).
 Collection<NODE> getExtraNeighbors(NODE node, Collection<NODE> mapNeighbors)
          This method may return new nodes which are not present in 'mapNeighbors' (as returned by IPFMap.getNeighbors(Object)).
 int getNodeExtraCost(NODE node, int mapCost)
          Method defining extra-node cost, that is a cost that is added to IPFMap.getNodeCost(Object).
 boolean isArcOpened(NODE nodeFrom, NODE nodeTo)
          Arcs filter.
 boolean isNodeOpened(NODE node)
          Nodes filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPFMapView.DefaultView

public IPFMapView.DefaultView()
Method Detail

getExtraNeighbors

public Collection<NODE> getExtraNeighbors(NODE node,
                                          Collection<NODE> mapNeighbors)
Description copied from interface: IPFMapView
This method may return new nodes which are not present in 'mapNeighbors' (as returned by IPFMap.getNeighbors(Object)). Such nodes are then exclusively accessible to your particular agent, that is, this methods is adding nodes that can be accessed by the agent but are not part of your general map description.

"node" MUST NOT BE ADDED TO "mapNeighbors"!

Returned collection must not contain multiple references to a single neighbor (multi-graph is forbidden).

Returned collection must not contain any node from "mapNeighbors".

Specified by:
getExtraNeighbors in interface IPFMapView<NODE>
mapNeighbors - neighbors of the "node" as returned by IPFMap.getNeighbors(Object), may return null

getArcExtraCost

public int getArcExtraCost(NODE nodeFrom,
                           NODE nodeTo,
                           int mapCost)
Description copied from interface: IPFMapView
Method defining extra-arc cost, that is a cost that is added to IPFMap.getArcCost(Object, Object).

This allows you to provide "customization" to the graph arc costs. It allows you to say "this is a cool arc to use for travel" (negative extra cost) or "this edge is hard to cross" (positive extra cost).

NOTE THAT YOU MUST AVOID HAVING NEGATIVELY-VALUED ARCs (IPFMap.getArcCost(Object, Object) + IPFMapView.getArcExtraCost(Object, Object, int) < 0)!

Such arcs might lead to negative-valued circles which will make exploratory algorithms to endlessly walk in circles.

Specified by:
getArcExtraCost in interface IPFMapView<NODE>
mapCost - cost of the arc as returned by underlying IPFMap.getArcCost(Object, Object)
Returns:

getNodeExtraCost

public int getNodeExtraCost(NODE node,
                            int mapCost)
Description copied from interface: IPFMapView
Method defining extra-node cost, that is a cost that is added to IPFMap.getNodeCost(Object).

This allows you to provide "customization" to the graph nodes, simply, it is a way of telling "this node is cool to have in path" (negative cost) or "this node is bad to have in path" (positive cost).

Specified by:
getNodeExtraCost in interface IPFMapView<NODE>
mapCost - cost of the node as returned by underlying IPFMap.getNodeCost(Object)
Returns:

isArcOpened

public boolean isArcOpened(NODE nodeFrom,
                           NODE nodeTo)
Description copied from interface: IPFMapView
Arcs filter. Method defining which "arc" (oriented links between nodes) can be used for the purpose of path-planning. It can be used to "forbid" usage of some arc, that is you can rule out some arc you do not want your agent to be able to travel.

Specified by:
isArcOpened in interface IPFMapView<NODE>
Returns:

isNodeOpened

public boolean isNodeOpened(NODE node)
Description copied from interface: IPFMapView
Nodes filter. Method defining which nodes are allowed to be explored / used by path finding algorithms, i.e., algorithm will never return path leading to such nodes. May be used to define "forbidden" nodes.

Specified by:
isNodeOpened in interface IPFMapView<NODE>
Returns:


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.