Class OSMEnvironment

  • All Implemented Interfaces:
    it.unibo.alchemist.model.BenchmarkableEnvironment , it.unibo.alchemist.model.Environment , it.unibo.alchemist.model.maps.MapEnvironment , java.io.Serializable , java.lang.Iterable

    
    public final class OSMEnvironment<T>
    extends Abstract2DEnvironment<T, P> implements MapEnvironment<T, O, S>
                        

    This class serves as template for more specific implementations of environments using a map. It encloses the navigation logic, but leaves the subclasses to decide how to provide map data (e.g. loading from disk or rely on online services). The data is then stored in-memory for performance reasons.

    • Constructor Detail

      • OSMEnvironment

        OSMEnvironment(Incarnation<T, GeoPosition> incarnation)
        Builds a new OSMEnvironment without an actual backing map.
        Parameters:
        incarnation - the incarnation to be used.
      • OSMEnvironment

        OSMEnvironment(Incarnation<T, GeoPosition> incarnation, String file)
        Builds a new OSMEnvironment, with nodes not forced on streets.
        Parameters:
        incarnation - the incarnation to be used.
        file - the file path where the map data is stored
      • OSMEnvironment

        OSMEnvironment(Incarnation<T, GeoPosition> incarnation, String file, boolean onStreets)
        Parameters:
        incarnation - the incarnation to be used.
        file - the file path where the map data is stored
        onStreets - if true, the nodes will be placed on the street nearest to the desired Position.
      • OSMEnvironment

        OSMEnvironment(Incarnation<T, GeoPosition> incarnation, String file, boolean onStreets, boolean onlyOnStreets)
        Parameters:
        incarnation - the incarnation to be used.
        file - the file path where the map data is stored
        onStreets - if true, the nodes will be placed on the street nearest to the desired Position.
        onlyOnStreets - if true, the nodes which are too far from a street will be simply discarded.
      • OSMEnvironment

        OSMEnvironment(Incarnation<T, GeoPosition> incarnation, String file, int approximation)
        Parameters:
        incarnation - the incarnation to be used.
        file - the file path where the map data is stored.
        approximation - the amount of ciphers of the IEEE 754 encoded position that may be discarded when comparing two positions, allowing a quicker retrieval of the route between two position, since the cache may already contain a similar route which can be considered to be the same route, according to the level of precision determined by this value
      • OSMEnvironment

        OSMEnvironment(Incarnation<T, GeoPosition> incarnation, String file, int approximation, boolean onStreets, boolean onlyOnStreets)
        Parameters:
        incarnation - the incarnation to be used.
        file - the file path where the map data is stored.
        approximation - the amount of ciphers of the IEEE 754 encoded position that may be discarded when comparing two positions, allowing a quicker retrieval of the route between two position, since the cache may already contain a similar route which can be considered to be the same route, according to the level of precision determined by this value
        onStreets - if true, the nodes will be placed on the street nearest to the desired Position.
        onlyOnStreets - if true, the nodes which are too far from a street will be simply discarded.