RandomMoveInGrid/architecture.txt -------------------------------------------------------- | | | | | | | | | Tick | | | | | | | | | Count: -------------------------------------------------------- Start Step Init Stop Pause Setup Quit GUIModel DisplaySurface extends Model -------------- --------------- | | Parameters, etc | durf | | ---------------- | worldDisplay | | | numAgents 20 | | colorMap | | | sizeX 10 | | | | | sizeY 10 | | | ---------------- -------------- ------------------------------------------------------------------------------------ Model extends ModelParameters extends SimModelImpl Object2DDisplay --------------------- -------- | | | | | numAgents 20 | | | | sizeX 10 | -------- | SizeY 10 | | | | schedule | Schedule | | ---------------------- | | | for each time step | | world | | this.step() | | agentList | ---------------------- Object2DGrid --------------------- --------------------- | | ----------------- | | | o o ... o | | | ----------------- | | | | --------- --------- --------- | | | ID 0 | | ID 1 | | ID 19 | --------------------- | x 8 | | x 2 | ... | x 4 | | y 1 | | y 5 | | y 3 | --------- --------- --------- ================================================================================== Model extend ModelParameters extends SimModelImpl - Inherits methods and IVs: built-in parameters, report processing, RNG start/access control panel, Settings windows, ... - Model (or its superclass) must implement some methods that respond appropriately to GUI buttom presses (and to get things started) - main() create the Model object (instance); init/load the model called once at run time (generally don't change) - setup() get ready to build model (setup => "tearDown"!) clear/set variables; create new, empty schedule called at run time, and by [SETUP] button - begin() build and initialize all the model parts: - buildModel() "conceptual" model parts - buildDisplay() any custom displays (rasters, plots, ...) - buildSchedule() the schedule of activity Buttons: [INITIALIZE] or first [STEP] or [RUN] - getInitParam() return array of parameter names (instance variables) to display in the Settings-Parameters window - getters/setters for instance variables -- to see/change in GUI - getSchedule() returns the schedule (used by Repast) advanced by [STEP] and [RUN] buttons