Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## turtlekit.kernel
Class Observer

    java.lang.Object
      madkit.kernel.AbstractAgent
          madkit.kernel.Watcher
              turtlekit.kernel.Observer

All Implemented Interfaces:
  java.io.Serializable, ReferenceableAgent

Direct Known Subclasses:
  AnimatObserver, AnimatObserver, AnimatObserver, CreationObserver, GasObserver, GridInitializer, GridPlayer, PatchInitializer, PatchInitializer, PatchInitializer, PatchInitializer, PredatorObserver, PredatorObserver, PredatorObserver, PreyObserver, PreyObserver, PreyObserver, ResourceManager, ResourceManager, ResourceManager, SoccerObserver, Viewer, VirusObserver

    public abstract class Observer

extends Watcher
implements ReferenceableAgent

Observer is an abstract class that have to be extended in order to initialize patches or make some observations. To observe turtle, create TurtleProbe on a special role and then add it using addProbe(); walkers = new TurtleProbe(getSimulationGroup(),"walker"); addProbe(walkers); You can specially create Turtle[] variables using TurtleProbe's getTurtles() method. This method permits to obtain an array of turtle regarding the role they play. MoreOver this agent has access to the patchGrid variable in order to observe or initialize the patches.

Version:
  3.0 20/02/2002
Author:
  Fabien MICHEL
See Also:
  `TurtleProbe`, Serialized Form

Field Summary
`int` | `envHeight`
`int` | `envWidth`
`Patch[][]` | `patchGrid`

Constructor Summary
`Observer()`

Method Summary
`void` | `activate()` MadKit kernel usage
`void` | `end()` the end method will remove all the probes which have been used by the scheduler.
`java.lang.String` | `getSimulationGroup()`
`void` | `setup()` override this method to make other initializations,not in constructor
`void` | `watch()` override this method to observe the state of the world using turtle tables or/and the patchGrid variable

Methods inherited from class madkit.kernel.Watcher
`addProbe, addProbe, getProbes, removeAllProbes, removeProbe, update`

Methods inherited from class madkit.kernel.AbstractAgent
`broadcastMessage, broadcastMessage, connectedWithCommunity, createGroup, createGroup, debug, destroyGroup, disposeMyGUI, foundGroup, getAddress, getAgentsWithRole, getAgentsWithRole, getAgentWithRole, getAgentWithRole, getAvailableCommunities, getBean, getController, getCurrentKernelAddress, getDebug, getExistingGroups, getExistingGroups, getExistingRoles, getExistingRoles, getGroups, getGUIObject, getMessageBoxSize, getMyGroups, getMyGroups, getMyRoles, getMyRoles, getName, getRoles, hasGUI, hashCode, hideMyGUI, initGUI, isBelongingToGroup, isBelongingToGroup, isCommunity, isGroup, isGroup, isMemberOf, isMemberOf, isMessageBoxEmpty, isRole, isRole, joinGroup, killAgent, launchAgent, launchAgent, leaveGroup, leaveGroup, leaveRole, leaveRole, nextMessage, print, println, receiveMessage, redisplayMyGUI, requestRole, requestRole, requestRole, restoreAgent, sendMessage, sendMessage, sendMessage, setBean, setController, setDebug, setGUIObject, setName, setOutput, setOutputWriter, toString, windowClosing`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### patchGrid

    public Patch[][] patchGrid

### envWidth

    public int envWidth

### envHeight

    public int envHeight

Constructor Detail

### Observer

    public Observer()

Method Detail

### activate

    public void activate()

  MadKit kernel usage

  Overrides:
    `activate` in class `AbstractAgent`

### end

    public void end()

  Description copied from class: `Watcher`
  the end method will remove all the probes which have been used by the scheduler. Overriding this method, one should use `super.end()` first in order to ease the removal of simulated agents which will be killed. Doing so can greatly improved the "killing time" of simulation engines

  Overrides:
    `end` in class `Watcher`
  See Also:
    `AbstractAgent.end()`

### getSimulationGroup

    public final java.lang.String getSimulationGroup()

### watch

    public void watch()

  override this method to observe the state of the world using turtle tables or/and the patchGrid variable

### setup

    public void setup()

  override this method to make other initializations,not in constructor

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.