Class Map

    • Field Detail

      • origin

        public Parameter origin
        A 2-d array denoting the map origin in x and y directions respectively.
      • resolution

        public Parameter resolution
        Map resolution in meters/pixel.
      • _decoratedObjects

        protected java.util.List<NamedObj> _decoratedObjects
        Cached list of decorated objects.
      • _decoratedObjectsVersion

        protected long _decoratedObjectsVersion
        Version for _decoratedObjects.
    • Constructor Detail

      • Map

        public Map​(CompositeEntity container,
                   java.lang.String name)
            throws IllegalActionException,
                   NameDuplicationException
        Construct a StateSpaceModel with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of this actor.
        Throws:
        IllegalActionException - If the container is incompatible with this actor.
        NameDuplicationException - If the name coincides with an actor already in the container.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Update the state accordingly.
        Overrides:
        attributeChanged in class NamedObj
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If stateVariableNamest cannot be evaluated or cannot be converted to the output type, or if the superclass throws it.
      • getOccupancyGrid

        public int[][] getOccupancyGrid()
        Return the occupancy grid.
        Returns:
        the occupancy grid
      • getOrigin

        public double[] getOrigin()
        Return the origin.
        Returns:
        the origin.
      • withinValidMapArea

        public boolean withinValidMapArea​(double xCoord,
                                          double yCoord)
        Check if queried (x,y) position is within the valid map area.
        Parameters:
        xCoord - The x coordinate
        yCoord - The y coordinate
        Returns:
        True if the position is within the valid map area.
      • description

        public java.lang.String description()
                                     throws IllegalActionException
        Description copied from class: NamedObj
        Return a full description of the object. This is accomplished by calling the description method with an argument for full detail. This method read-synchronizes on the workspace.
        Specified by:
        description in interface Nameable
        Overrides:
        description in class NamedObj
        Returns:
        A description of the object.
        Throws:
        IllegalActionException - Not thrown in this base class, but derived classes could throw an exception if there is a problem accessing subcomponents of this object.
        See Also:
        NamedObj.exportMoML(Writer, int, String)
      • createDecoratorAttributes

        public DecoratorAttributes createDecoratorAttributes​(NamedObj target)
                                                      throws IllegalActionException
        Description copied from interface: Decorator
        Create and return the decorated attributes for the target NamedObj. Implementations of this method should create an Attribute that implements DecoratorAttributes. Implementations should populate that attribute with parameters that have appropriate default values.

        This method is called if NamedObj.getDecoratorAttribute(Decorator, String) or NamedObj.getDecoratorAttributes(Decorator) is called, and the specified target object does not already have decorated attributes for this decorator.

        The implementer of this method is responsible for ensuring consistency with the Decorator.decoratedObjects() method. Specifically, any object returned by Decorator.decoratedObjects(), when passed as an argument to this method, should not result in a null returned value. And conversely, any object passed to this method that is not in the list returned by decoratedObjects() should result in a null returned value.

        Specified by:
        createDecoratorAttributes in interface Decorator
        Parameters:
        target - The NamedObj that will be decorated.
        Returns:
        The decorated attributes for the target NamedObj, or null if the specified NamedObj is not decorated by this decorator.
        Throws:
        IllegalActionException - If the target cannot be determined to be decorated or not (e.g., a parameter cannot be evaluated).
      • isGlobalDecorator

        public boolean isGlobalDecorator()
                                  throws IllegalActionException
        Description copied from interface: Decorator
        Return true if this decorator should decorate objects across opaque hierarchy boundaries. That is, return true to make this decorator visible to objects even within opaque composites.
        Specified by:
        isGlobalDecorator in interface Decorator
        Returns:
        True if decorator is global.
        Throws:
        IllegalActionException - If it cannot be determined whether this is global or not (e.g., a parameter cannot be evaluated).