cz.cuni.amis.pogamut.defcon.communication.worldview.polygons
Class GameMapInfoPolygons

Package class diagram package GameMapInfoPolygons
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensorModule<DefConAgent>
          extended by cz.cuni.amis.pogamut.defcon.communication.worldview.polygons.GameMapInfoPolygons
All Implemented Interfaces:
IComponent

public class GameMapInfoPolygons
extends SensorModule<DefConAgent>

Module containing polygonal description of certain features of map.

Author:
Radek 'Black_Hand' Pibil

Field Summary
protected  int currentEnemyId
          Current enemy id in case based on territory.
protected  BasicFlag currentFlag
          Currently processed flag
protected  int currentTerritoryId
          Current territory id in case of TERRITORY flags
protected  TreeMap<Integer,SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>>> enemyTerritories
          List of enemy territories.
protected  IFlagChecker flagChecker
          Flag checker for queries to map features
protected  List<List<DefConLocation>> land
          Land.
protected  int lastAssignedTerritory
           
protected  double minX
           
protected  double minY
           
protected  TreeMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> ownTerritories
          List of own territories.
protected  List<List<DefConLocation>> sea
          Sea.
protected  float SIMPLIFICATION_FACTOR
          Factor of polygon's area to vertices count.
protected  float STEP_SIZE
          Size of a sampling step.
protected  ArrayList<Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> territories
          Territories.
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule
worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
GameMapInfoPolygons(DefConAgent<?> agent, IFlagChecker flagChecker)
           
GameMapInfoPolygons(DefConAgent<?> agent, IFlagChecker flagChecker, String preprocessedPath)
           
GameMapInfoPolygons(DefConAgent<?> agent, IFlagChecker flagChecker, String preprocessedPath, Logger log)
           
GameMapInfoPolygons(DefConAgent<?> agent, IFlagChecker flagChecker, String preprocessedPath, Logger log, ComponentDependencies dependencies)
           
 
Method Summary
 SortedMap<Integer,SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>>> getEnemiesTerritories()
           
 SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> getEnemyTerritories(int enemyId)
          Returns a list of territories the enemy has.
 List<List<DefConLocation>> getLand()
          Returns contours of negation of sea.
 SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> getOwnTerritories()
           
 List<List<DefConLocation>> getSea()
          Returns contours of sea.
 Pair<List<List<DefConLocation>>,List<List<DefConLocation>>> getTerritory(int territoryId)
          Returns a single territory.
 DefConWorldView getWorldView()
           
protected  void processMap()
          Processes the map from scratch.
 void saveBorders(IPrecomputedBordersSaver saver)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STEP_SIZE

protected final float STEP_SIZE
Size of a sampling step.

See Also:
Constant Field Values

SIMPLIFICATION_FACTOR

protected final float SIMPLIFICATION_FACTOR
Factor of polygon's area to vertices count. If the factor of count vertices to the area is greater than SIMPLIFICATION_FACTOR, then it gets simplified.

See Also:
Constant Field Values

territories

protected ArrayList<Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> territories
Territories. First member is sea, the second is land.


ownTerritories

protected TreeMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> ownTerritories
List of own territories.


enemyTerritories

protected TreeMap<Integer,SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>>> enemyTerritories
List of enemy territories.


land

protected List<List<DefConLocation>> land
Land.


sea

protected List<List<DefConLocation>> sea
Sea.


flagChecker

protected IFlagChecker flagChecker
Flag checker for queries to map features


currentFlag

protected BasicFlag currentFlag
Currently processed flag


currentTerritoryId

protected int currentTerritoryId
Current territory id in case of TERRITORY flags


currentEnemyId

protected int currentEnemyId
Current enemy id in case based on territory.


lastAssignedTerritory

protected int lastAssignedTerritory

minX

protected double minX

minY

protected double minY
Constructor Detail

GameMapInfoPolygons

public GameMapInfoPolygons(DefConAgent<?> agent,
                           IFlagChecker flagChecker)

GameMapInfoPolygons

public GameMapInfoPolygons(DefConAgent<?> agent,
                           IFlagChecker flagChecker,
                           String preprocessedPath)

GameMapInfoPolygons

public GameMapInfoPolygons(DefConAgent<?> agent,
                           IFlagChecker flagChecker,
                           String preprocessedPath,
                           Logger log)

GameMapInfoPolygons

public GameMapInfoPolygons(DefConAgent<?> agent,
                           IFlagChecker flagChecker,
                           String preprocessedPath,
                           Logger log,
                           ComponentDependencies dependencies)
Method Detail

saveBorders

public void saveBorders(IPrecomputedBordersSaver saver)

getWorldView

public DefConWorldView getWorldView()

processMap

protected void processMap()
Processes the map from scratch.


getOwnTerritories

public SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> getOwnTerritories()

getEnemiesTerritories

public SortedMap<Integer,SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>>> getEnemiesTerritories()

getTerritory

public Pair<List<List<DefConLocation>>,List<List<DefConLocation>>> getTerritory(int territoryId)
Returns a single territory.

Parameters:
territoryId -
Returns:

getEnemyTerritories

public SortedMap<Integer,Pair<List<List<DefConLocation>>,List<List<DefConLocation>>>> getEnemyTerritories(int enemyId)
Returns a list of territories the enemy has.

Parameters:
enemyId -
Returns:

getLand

public List<List<DefConLocation>> getLand()
Returns contours of negation of sea.

Returns:

getSea

public List<List<DefConLocation>> getSea()
Returns contours of sea.

Returns:


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