Skip to content

3.1.2 File Generation

greg737 edited this page Aug 27, 2015 · 6 revisions

###World File The world file is done by the generateWorld script. It creates the boundary and generates the rows of orchards which is configurable.

###Entity Generation Generation of the entity files are done by the generateEntity script which generates script for each type of entity and the number for each type is determined in the config file. The generation is done by using a template file for each entity type and changing the constructor to have the correct inputs like id number and initial x and y values. The generateEntity script also writes to the world file to include the entity models and their initial positions. generateEntity_diagram

The generateEntity script also starts the entity scripts after generating them. This step is not done if the launcher is in testing mode.

Adding New Entities

To add new entities to be generated, the following files are needed and placed in their specific directory:

  • Class file in se306Project1/src
  • Model file in /world/objects (file must end with .inc)
  • Template file in /world/templates (file must end with .template)

Complete the steps below to ensure files are generated correctly:

  1. Include model file of the entity at the top of the World Template
  2. Add entity name to the robot_type list(Line 33) in generateEntity *
  3. Include in the config.properties, the number of robots.

Example: (Entity_Name).number=2

*The entity name(case-sensitive) must be same as the class name and the model name.

###Obstacle Generation Obstacles are placed at random positions along the trees to block the path of the robots but are not placed too close to each other so that the robot can still navigate around the obstacles. The number generated are also based on the config file. obstacle1 obstacle2

Clone this wiki locally