cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.model
Class VisibilityMatrix

Package class diagram package VisibilityMatrix
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.model.VisibilityMatrix
All Implemented Interfaces:
Serializable

public class VisibilityMatrix
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
protected VisibilityMatrix()
           
  VisibilityMatrix(String mapName, int size)
           
 
Method Summary
 Set<NavPoint> getCoverNavPoints(BitSet column)
          Returns all NavPoint that are NOT visible according to 'column' (column[key] == FALSE, locations.get(key) included if NavPoint).
 Set<NavPoint> getCoverNavPoints(ILocated loc)
          Returns set of NavPoint that are not visible from "loc".
 Set<NavPoint> getCoverNavPointsN(ILocated... locs)
          Returns set of NavPoint that are not visible from any 'locs'.
 Set<VisibilityLocation> getCoverPoints(BitSet column)
          Returns all VisibilityLocation that are NOT visible according to 'column' (column[key] == FALSE, locations.get(key) included).
 Set<VisibilityLocation> getCoverPoints(ILocated loc)
          Returns set of VisibilityLocation that are not visible from "loc".
 Set<VisibilityLocation> getCoverPointsN(ILocated... locs)
          Returns set of VisibilityLocation that are not visible from any 'locs'.
static File getFile_All(File directory, String mapName)
           
static String getFileName_All(String mapName)
           
 VisibilityLocation getLocation(int index)
           
 Map<Integer,VisibilityLocation> getLocations()
           
 String getMapName()
           
 BitMatrix getMatrix()
          TRUE == visible FALSE == not-visible
 Set<NavPoint> getNavPoints(Collection<VisibilityLocation> visibilityLocations)
          Returns nav points from 'visibilityLocations'.
 VisibilityLocation getNearest(ILocated located)
          Nearest VisibilityLocation to 'located'.
 NavPoint getNearestCoverNavPoint(ILocated loc)
          Returns nearest cover NavPoint to 'loc'.
 NavPoint getNearestCoverNavPoint(ILocated target, ILocated loc)
          Returns nearest cover NavPoint against 'from' for 'target'.
 NavPoint getNearestCoverNavPointN(ILocated target, ILocated... coveredFrom)
          Returns nearest cover nav point for 'target' that is covered from all 'coveredFrom'.
 VisibilityLocation getNearestCoverPoint(ILocated loc)
          Returns nearest cover point to 'loc'.
 VisibilityLocation getNearestCoverPoint(ILocated target, ILocated from)
          Returns nearest cover point agains 'from' for 'target'.
 VisibilityLocation getNearestCoverPointN(ILocated target, ILocated... coveredFrom)
          Returns nearest cover point for 'target' that is covered from all 'coveredFrom'.
 Map.Entry<Integer,VisibilityLocation> getNearestEntry(ILocated located)
          Nearest key-VisibilityLocation entry to 'located'.
 Integer getNearestIndex(ILocated located)
          Nearest VisibilityLocation index to 'located'.
 Set<Integer> getNearestIndices(ILocated... locs)
          Returns indices of nearest VisibilityLocation for 'locs'.
 NavPoint getNearestNavPoint(ILocated located)
          Nearest VisibilityLocation to 'located'.
 int getPairCount()
          Return total number of locations-pairs (not including X-X).
 Set<NavPoint> getVisibleNavPoints(BitSet column)
          Returns all NavPoint that are visible according to 'column' (column[key] == TRUE, locations.get(key) included if NavPoint).
 Set<NavPoint> getVisibleNavPoints(ILocated loc)
          Returns set of NavPoint that are visible from "loc".
 int getVisiblePairCount()
          Return total number of visible pairs.
 Set<VisibilityLocation> getVisiblePoints(BitSet column)
          Returns all VisibilityLocation that are visible according to 'column' (column[key] == TRUE, locations.get(key) included).
 Set<VisibilityLocation> getVisiblePoints(ILocated loc)
          Returns set of VisibilityLocation that are visible from "loc".
 boolean isVisible(ILocated loc1, ILocated loc2)
          Returns whether loc1 is visible from loc2 (and vice versa == symmetrix info).
static VisibilityMatrix load(File directory, String mapName)
           
 void save(File directory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisibilityMatrix

protected VisibilityMatrix()

VisibilityMatrix

public VisibilityMatrix(String mapName,
                        int size)
Method Detail

getMapName

public String getMapName()

getLocations

public Map<Integer,VisibilityLocation> getLocations()

getLocation

public VisibilityLocation getLocation(int index)

getMatrix

public BitMatrix getMatrix()
TRUE == visible FALSE == not-visible

Returns:

getFileName_All

public static String getFileName_All(String mapName)

getFile_All

public static File getFile_All(File directory,
                               String mapName)

save

public void save(File directory)

load

public static VisibilityMatrix load(File directory,
                                    String mapName)

getPairCount

public int getPairCount()
Return total number of locations-pairs (not including X-X).

Returns:

getVisiblePairCount

public int getVisiblePairCount()
Return total number of visible pairs. WARNING: O(n^2) time complexity.

Returns:

getVisiblePoints

public Set<VisibilityLocation> getVisiblePoints(BitSet column)
Returns all VisibilityLocation that are visible according to 'column' (column[key] == TRUE, locations.get(key) included).

Parameters:
column -
Returns:

getVisibleNavPoints

public Set<NavPoint> getVisibleNavPoints(BitSet column)
Returns all NavPoint that are visible according to 'column' (column[key] == TRUE, locations.get(key) included if NavPoint).

Parameters:
column -
Returns:

getNavPoints

public Set<NavPoint> getNavPoints(Collection<VisibilityLocation> visibilityLocations)
Returns nav points from 'visibilityLocations'.

Parameters:
visibilityLocations -
Returns:

getCoverPoints

public Set<VisibilityLocation> getCoverPoints(BitSet column)
Returns all VisibilityLocation that are NOT visible according to 'column' (column[key] == FALSE, locations.get(key) included).

Parameters:
column -
Returns:

getCoverNavPoints

public Set<NavPoint> getCoverNavPoints(BitSet column)
Returns all NavPoint that are NOT visible according to 'column' (column[key] == FALSE, locations.get(key) included if NavPoint).

Parameters:
column -
Returns:

getNearestEntry

public Map.Entry<Integer,VisibilityLocation> getNearestEntry(ILocated located)
Nearest key-VisibilityLocation entry to 'located'.


getNearest

public VisibilityLocation getNearest(ILocated located)
Nearest VisibilityLocation to 'located'.

Parameters:
located -
Returns:

getNearestNavPoint

public NavPoint getNearestNavPoint(ILocated located)
Nearest VisibilityLocation to 'located'.

Parameters:
located -
Returns:

getNearestIndex

public Integer getNearestIndex(ILocated located)
Nearest VisibilityLocation index to 'located'.

Parameters:
located -
Returns:

isVisible

public boolean isVisible(ILocated loc1,
                         ILocated loc2)
Returns whether loc1 is visible from loc2 (and vice versa == symmetrix info). Note that the information is only aproximated by obtaining nearest known VisibilityLocation. The information is accurate for navpoints and very accurate for points on links between navpoints. If module is not Visibility.isInitialized(), returns false.

Returns:

getCoverPoints

public Set<VisibilityLocation> getCoverPoints(ILocated loc)
Returns set of VisibilityLocation that are not visible from "loc".

Parameters:
loc -
Returns:

getNearestCoverPoint

public VisibilityLocation getNearestCoverPoint(ILocated loc)
Returns nearest cover point to 'loc'.

Parameters:
loc -
Returns:

getNearestCoverPoint

public VisibilityLocation getNearestCoverPoint(ILocated target,
                                               ILocated from)
Returns nearest cover point agains 'from' for 'target'.

Parameters:
from -
Returns:

getVisiblePoints

public Set<VisibilityLocation> getVisiblePoints(ILocated loc)
Returns set of VisibilityLocation that are visible from "loc".

Parameters:
loc -
Returns:

getCoverNavPoints

public Set<NavPoint> getCoverNavPoints(ILocated loc)
Returns set of NavPoint that are not visible from "loc".

Parameters:
loc -
Returns:

getNearestCoverNavPoint

public NavPoint getNearestCoverNavPoint(ILocated loc)
Returns nearest cover NavPoint to 'loc'.

Parameters:
loc -
Returns:

getNearestCoverNavPoint

public NavPoint getNearestCoverNavPoint(ILocated target,
                                        ILocated loc)
Returns nearest cover NavPoint against 'from' for 'target'.

Parameters:
loc -
Returns:

getVisibleNavPoints

public Set<NavPoint> getVisibleNavPoints(ILocated loc)
Returns set of NavPoint that are visible from "loc".

Parameters:
loc -
Returns:

getNearestIndices

public Set<Integer> getNearestIndices(ILocated... locs)
Returns indices of nearest VisibilityLocation for 'locs'.

Parameters:
locs -
Returns:

getCoverPointsN

public Set<VisibilityLocation> getCoverPointsN(ILocated... locs)
Returns set of VisibilityLocation that are not visible from any 'locs'.

Parameters:
locs -
Returns:

getNearestCoverPointN

public VisibilityLocation getNearestCoverPointN(ILocated target,
                                                ILocated... coveredFrom)
Returns nearest cover point for 'target' that is covered from all 'coveredFrom'.

Parameters:
target -
coveredFrom -
Returns:

getCoverNavPointsN

public Set<NavPoint> getCoverNavPointsN(ILocated... locs)
Returns set of NavPoint that are not visible from any 'locs'.

Parameters:
locs -
Returns:

getNearestCoverNavPointN

public NavPoint getNearestCoverNavPointN(ILocated target,
                                         ILocated... coveredFrom)
Returns nearest cover nav point for 'target' that is covered from all 'coveredFrom'.

Parameters:
target -
coveredFrom -
Returns:


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