public class MRVMRegionsMap extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
MRVMRegionsMap.Region |
| Constructor and Description |
|---|
MRVMRegionsMap(MRVMWorldSetup worldStructure,
RNGSupplier rngSupplier) |
| Modifier and Type | Method and Description |
|---|---|
Set<MRVMRegionsMap.Region> |
adjacentRegions(MRVMRegionsMap.Region region) |
boolean |
areAdjacent(MRVMRegionsMap.Region region,
MRVMRegionsMap.Region otherRegion) |
boolean |
equals(Object obj) |
int |
getDistance(MRVMRegionsMap.Region regionOne,
MRVMRegionsMap.Region regionTwo)
Calculates the distance between two regions in this map.
Distance is defined as the length of the shortest path in a graph representation of this map, where two regions share an edge if and only if they are adjacent. |
int |
getLongestShortestPath(MRVMRegionsMap.Region region)
Returns the length of the longest shortest path in the adjacency graph between the specified region and any other region.
|
int |
getNumberOfRegions() |
MRVMRegionsMap.Region |
getRegion(int id) |
Set<MRVMRegionsMap.Region> |
getRegions() |
protected org.jgrapht.graph.UnmodifiableGraph<MRVMRegionsMap.Region,org.jgrapht.graph.DefaultEdge> |
getSubgraph(Set<MRVMRegionsMap.Region> regions)
Creates a new, unmodifiable regions-graph, consistent with the adjacency graph of this map,
but only containing the specified set of regions as vertices.
|
int |
hashCode() |
public MRVMRegionsMap(MRVMWorldSetup worldStructure, RNGSupplier rngSupplier)
public int getLongestShortestPath(MRVMRegionsMap.Region region)
public Set<MRVMRegionsMap.Region> adjacentRegions(MRVMRegionsMap.Region region)
protected org.jgrapht.graph.UnmodifiableGraph<MRVMRegionsMap.Region,org.jgrapht.graph.DefaultEdge> getSubgraph(Set<MRVMRegionsMap.Region> regions)
getDistance(Region, Region),
adjacentRegions(Region) and similar methods on the regions in the returned graph will return the values
w.r.t. the original graph in the map.public boolean areAdjacent(MRVMRegionsMap.Region region, MRVMRegionsMap.Region otherRegion)
public int getDistance(MRVMRegionsMap.Region regionOne, MRVMRegionsMap.Region regionTwo)
getNumberOfRegions()-1 is returned.public Set<MRVMRegionsMap.Region> getRegions()
public int getNumberOfRegions()
public MRVMRegionsMap.Region getRegion(int id)
Copyright © 2017. All rights reserved.