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.

object : 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.

Methods:

  • addDependency
  • announce
  • archive
  • archiveAsXml
  • callMethod
  • canRespond
  • dearchive
  • delete
  • destroy
  • getAge
  • getController
  • getDescription
  • getType
  • init
  • isA
  • isASubclass
  • iterate
  • observe
  • postDearchiveSetController
  • removeDependency
  • schedule
  • scheduleRepeating
  • sendOverNetwork
  • unobserve
    addDependency( self, i )

    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( self, theMessage )

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


    archive( self )


    archiveAsXml( self, fileName )

    Writes the current object to the XML file fileName.


    callMethod( self, methodName, argList )

    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.


    canRespond( self, methodName )

    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".


    dearchive( self )


    delete( self )

    Automatically called when this object is freed. This method should never be called manually. If subclasses need to free objects or data, they should implement their own "destroy" methods.


    destroy( self )

    Automatically called when this object is freed. This method should never be called manually. If subclasses need to free objects or data, they should implement their own "destroy" methods.


    getAge( self )

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


    getController( self )

    Returns the controller object that associated with the current simulation. It's preferable to simply reference the variable "controller".


    getDescription( self )

    This method should provide a textual description of an object. When the "print" command prints an object, it calls this method to get a description of the object. By default, print will show the class and pointer of an object, but by overriding this method in your own classes, you can append other sorts of data to the output.


    getType( self )

    Returns as a string the type of this object.


    init( self )


    isA( self, className )

    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.


    isASubclass( self, className )

    Returns 1 if this object is a subclass of the class specified with className, returns 0 otherwise.


    iterate( self )


    observe( self, theObject, theNotification, theMethod )

    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.


    postDearchiveSetController( self )

    Used internally to set the controller instance for this variable. Used after object dearchiving.


    removeDependency( self, theObject )

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


    schedule( self, theMethod, theTime )

    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.


    scheduleRepeating( self, theMethod, theInterval )


    sendOverNetwork( self, hostName, portNumber )

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


    unobserve( self, theObject, theNotification )

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