Subscribe via Email

Saturday, April 23, 2016

morris_AIMA [#3]: Visualizing the Environment

The last set of updates involve loading/saving environment data and transferring the environment state to the Visualizer where it may be rendered for display.

Loading and Transferring State

    Environment files, currently, are JSON files with the following attributes:
      Environment: JSON object containing everything for the environment.
          type: type of environment, "TileEnvironment", "VacuumEnvironment" etc.
          size: this depends on the type of environment. For a grid, it may contain width/height, for example.

    Here is a sample file for a TileEnvironment. Notice the "tiles" attribute, since we need to specify which tiles have what content.

    Environment output format is slightly different because generating locations for each tile as shown for input was shown to be difficult... The output file
      Output file for TileEnvironment 
    The output format also contains "age" to specify how many cycles the environment has been through. This extra info may be useful to show debug info in the visualizer, perhaps.


High-Level Design of Simulation Phases

   Here is a high-level look at what will happen in a simulation.


It's best to just develop and not think too much. No matter what I do, I'll realize it was dumb within a year of more university/taking software engineering, so it's best to get this stuff out of the way and focus on the ai material soon. I think these 4 stages will be sufficient for the time being.


What's Next? 

Going to start the actual Vacuum World simulation outlined by the AIMA book. I'll briefly describe the setup and give my design approach for it in the next post. I will mainly need: 

  •     Design for Percepts 
  •     Design for Performance Measure
  •     More concrete specification of how environment cycle will work/how agents act.
The most important aspect will be to ensure my percept/other component design is as modular as possible since I'll be needing to develop everything else in the book at some point. I'll avoid implementing more than I need for a simple vacuum simulation, but I'm trying to leave ends open so I can add components to it easily if needed without having to go back and hack up the earlier parts. 



Extra: Projections (possible, undecided changes for the future)


  • Update map loading approach to be more general, instead of TileEnvironment having "tiles" as a JSON object with each tiles info, just have "size", "entities", and more general labels, then inside the detail is more complex. This way you just feed type in as config option and the environment constructor that gets it will know how to interpret those same labels.
  • Design factories for selecting simulator, or environment/visualizer, something. Not sure if needed yet, but we'll see once there is more than 1 simulation.
  • Decide if I should put my solution set for short answer questions as blog content, or at least put them online/link to them. There is already a solution set for the book, but varying opinion can be nice since much of it is either subjective or needing updates to keep up with current research.



No comments:

Post a Comment

Please feel free to give feedback/criticism, or other suggestions! (be gentle)

Subscribe to Updates via Email