make-duplicate-instance-changing-classGBBopen Corenext-class-instance-numbermake-instanceGoTo Top

make-instance   class &rest initargs &key &allow-other-keys => instance[Generic Function]

Create a new instance of class, such as a new unit instance.

Method signatures

make-instance  (class standard-class) &rest initargs => instance
make-instance  (class symbol) &rest initargs => instance

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

class     A class designator
initargs     An initialization argument list
instance     A standard-object instance

The newly created instance of class.

When a unit instance is created, events are signaled in the following sequence:

  1. An nonlink-slot-updated-event or link-event is signaled for each initialized slot in the newly created unit instance. A link-event is also signaled for each inverse pointer from an existing unit instance to the newly created unit instance.
  2. An instance-added-to-space-instance-event is signaled for each space instance on which the newly created unit instance is added.
  3. A instance-created-event is signaled.

Use of an initialization argument that has not been declared as valid.

If class is a unit class and the supplied or generated instance name is identical to the instance name of an existing unit instance of class.

Specifying a :space-instances initialization argument causes that value to be used instead of the :initial-space-instances specification associated with the unit class. Similarly, specifying a :instance-name initialization argument causes that value to be used as the instance name of the newly created unit instance instead of the instance-name counter value associated with the unit class (if the :use-global-instance-name-counter class option is nil or was not specified for the unit class) or the global instance-name counter value (if the :use-global-instance-name-counter class option is true for the unit class).

See also

Create a new hyp unit instance:

  > (make-instance 'hyp 
       :location (list x y)
       :classification '(:car :truck)
       :color ':gray
       :belief .85
       :velocity-range '(5 35)
       :supporting-hyps supporting-hyps)
  #<hyp 419 (1835 4791) 0.85 [5..35]>

The function make-space-instance provides a clear and convenient shorthand for creating space instances.

The GBBopen Project

make-duplicate-instance-changing-classGBBopen Corenext-class-instance-numbermake-instanceGoTo Top