These pages are auto-generated from self-documenting comments embedded in class files.
For more information on breve and steve, refer to the breve homepage.

## (no parent) : Object

This class is included as part of the file Object.tz.
To use this class in a simulation, include the line "@use Object."

### Class description:

> Summary: the top level object class.

> The Object class is the root class. All classes used in breve have Object as an ancestor. The object class implements some basic services that all classes will have access to.

> Subclassing Object directly is rare. The classes Real and Abstract are logical separations of the Object class containing "real" objects (which correspond to a physical entity in the simulated world) and "abstract" objects which are generally used for computation or control of the real objects. You should consider subclassing one of these classes instead.

### Class methods:

> Garbage Collection and Memory Management

> - disable-auto-free
> - enable-auto-free

> Getting Information About an Object

> - can-respond
> - get-age
> - get-type
> - is-a

> Scheduling Events and Notificiations

> - announce
> - call-method
> - call-method
> - observe
> - schedule
> - unobserve

> Archiving & Dearchiving

> - add-dependency
> - archive-as-xml
> - archive-as-xml-string
> - remove-dependency
> - send-over-network

`add-dependency on i (object)`

> Makes this instance depend on instance i when archiving and dearchiving. This means that if this instance is archived, then i will also have to be archived, and that when this instance is dearchived, that i will have to be dearchived first.

> Dependencies can cause large numbers of instances to be archived in response to a single archiving event (as dependencies of dependencies, and dependencies of dependencies of dependencies, ad infinitum will also be archived). This means that you should make dependencies sparingly, only when absolutely required.

> Circular dependencies are forbidden.

`announce message theMessage (string)`

> Sends a notification with the message theMessage to all observer objects. See observe for information on making an object an observer.

`archive-as-xml file fileName (string)`

> XML encodes this object, and writes the encoded string to the file fileName.

`archive-as-xml-string`

> XML encodes this object, and returns the encoded string.

`call-method named methodName (string)`

> Calls the method named methodName for this object. Returns the result of the method call.

`call-method named methodName (string) with-arguments argList (list)`

> Calls the method named methodName for this object. Returns the result of the method call.

> The arguments to the object are passed in using the list argList. Since keywords are not passed in, this method relies on the order the arguments appear in the argument list and passes them to methodName in the order in which they appear in methodName's definition.

> Why not call a method directly? This method is used in circumstances where you might want to have some sort of callback method. As an example, let's say you write a general purpose class which can sort objects based on different criteria. How would the user specify these arbitrary criteria? Using this method would allow the user to pass in the name of the method they want to use, and the sorting object could use this method to execute the callback.

> If the concept of a callback doesn't make sense, then you can probably ignore this method.

`can-respond to methodName (string)`

> Returns true or false (1 or 0) depending on whether this instance can respond to a method called methodName.

> But wow, what an awkward declaration! Same reason as the method is. Again, works like a statement that replies with true or false: object can-respond to "run".

> It's really not my fault that the infinitive of "can" is "be able".

`disable-auto-free`

> Disables garbage collection on a per-object basis.

`enable-auto-free`

> Enables garbage collection on a per-object basis.

`get-age`

> Returns the number of seconds this object has existed in the simulation.

`get-type`

> Returns as a string the type of this object.

`is-a class className (string)`

> This method returns true or false (1 or 0) depending on whether the instance in question belongs to class className. This method checks if className is a superclass of the current object as well.

`observe instance theObject (object) for-notification theNotification (string) with-method theMethod (string)`

> Causes the current object to observe theObject. By registering as and observer, the current object will receive a call to theMethod whenever theObject calls the announce method with notificiation theNotification.

`remove-dependency on theObject (object)`

> Removes theObject from this object's dependency list. See add-dependency for more information on dependencies.

`schedule method-call theMethod (string) at-time theTime (float)`

> Schedules a call to theMethod when the simulation time equals theTime. The margin of error of the callback time is equal to iteration step (see set-iteration-step).
> If you want to schedule an event at a time relative to the current time, use the method get-time to get the current simulation time and then add the offset you want.

`send-over-network to hostName (string) on portNumber (int)`

> Sends this object over the network to a breve server on host hostName listening on port portNumber.

`unobserve instance theObject (object) for-notification theNotification (string)`

> Unregisters the current object as an observer of theObject with notification theNotification.

Documentation created Thu Jul 3 18:18:12 2008