Package cmion.storage

Class WorldModel


public class WorldModel extends CmionStorageContainer
a specific subclass of cmion storage container with convenience methods added for handling "agent" and "object" sub containers.
  • Field Details

    • AGENT_TYPE_NAME

      public static String AGENT_TYPE_NAME
    • OBJECT_TYPE_NAME

      public static String OBJECT_TYPE_NAME
  • Constructor Details

  • Method Details

    • requestAddAgent

      public void requestAddAgent(String name)
      request adding an agent to the world model
    • requestAddAgent

      public void requestAddAgent(String name, HashMap<String,Object> initialProperties)
      request adding an agent to the world model
    • requestAddAgent

      public void requestAddAgent(String name, HashMap<String,Object> initialProperties, HashSet<String> persistentProperties)
      request adding an agent to the world model
    • requestRemoveAgent

      public void requestRemoveAgent(String name)
      request removing an agent from the world model
    • requestAddObject

      public void requestAddObject(String name)
      request adding an object to the world model
    • requestAddObject

      public void requestAddObject(String name, HashMap<String,Object> initialProperties)
      request adding an object to the world model
    • requestAddObject

      public void requestAddObject(String name, HashMap<String,Object> initialProperties, HashSet<String> persistentProperties)
      request adding an object to the world model
    • requestRemoveObject

      public void requestRemoveObject(String name)
      request removing an object from the world model
    • hasAgent

      public boolean hasAgent(String name)
      returns whether the world model has an agent of the specified name
    • hasObject

      public boolean hasObject(String name)
      returns whether the world model has an object of the specified name
    • getAgentNames

      public ArrayList<String> getAgentNames()
      returns a list of the names of all agents
    • getObjectNames

      public ArrayList<String> getObjectNames()
      returns a list of the names of all objects
    • getAgent

      public CmionStorageContainer getAgent(String name)
      returns the agent storage container with the specified name or null if it does not exist in this world model
    • getObject

      public CmionStorageContainer getObject(String name)
      returns the object storage container with the specified name or null if it does not exist in this world model
    • openInitFile

      protected InputStream openInitFile(String initFileName) throws Exception
      Throws:
      Exception
    • loadInitFile

      public void loadInitFile(String initFile) throws Exception
      Load the initial contents for the world model from the specified file
      Throws:
      Exception