AntPheromones2/gui-graphics-note.txt ------------------------------------ A brief description of the parts involved in display the GUI-graph (plot) as the model is run. It displays averageBugNbor1Count - avg # of 1-step neighbors ( aka avgBN1 ) averageBugNBor2Count - avg # pf 2-step neighbors ( aka avgBN2 ) Recall GUIModel extends AntPheromones. GUIModel // instance variable with address of the OpenSequenceGraph instance avgGraph -----------------------------------------> OpenSequenceGraph sequence1: points to ic1 sequence2: points to ic2 // instances of these two "inner classes" are created // and their addresses (ic1,ic2) are sent to the avgGraph instance // by sending the addSequence() message to the avgGraph // in buildDisplay() in GUIModel. ------------------------------------------------- | ic1 AverageBugNbor1Count implements Sequence | | getSValue() returns avgBN1 | ------------------------------------------------- ------------------------------------------------- | ic2 AverageBugNbor2Count implements Sequence | | getSValue() returns avgBN2 | ------------------------------------------------- AntPheromones // Instance variables to store these values, calculated by // calculateBugStatistics() called from stepReport() double averageBugNbor1Count; // ( aka avgBN1 ) double averageBugNBor2Count; // ( aka avgBN2 ) The schedule [defined in buildSchedule() in GUIModel] has one method it excutes each time click: step() defined in GUIModel That method sends these three messages: super.step() Ask the model to execute *its* step() method - diffuse the pSpace - the ants move - update pSpace with exogenous pheronome - stepReport(), which sends this message (to itself): - calculateBugStatistics() which calculates the avgBN1, avgBN2 values and stores them in those AntPheromone fields. surf.updateDisplay() -> tells the Value2DDisplay to draw colors, based on pSpace -> tells the Object2DDisplay to draw objects, based on world avgGraph.step() asks the graph (plot) object to data from this time step! It sends the getSValue() message to each Sequence instance that has been added to it.