![]() | ![]() | ![]() | make-instance | ![]() |
|
| class
&rest initargs
&key &allow-other-keys
=> instance | [Generic Function] |
Purpose
Create a new instance of class, such as a new
unit instance.
Method signatures
(class standard-class)
&rest initargs
=> 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
|
Returns
The newly created instance of class.
Events
When a unit instance is created, events are signaled in the
following sequence:
update-nonlink-slot-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.
add-instance-to-space-instance-event is signaled
for each space instance on which the newly created
unit instance is added.
create-instance-event is signaled.
Errors
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.
Description
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
change-class
define-event-class
define-unit-class
define-space-class
delete-instance
describe-instance
initial-class-instance-number
instance-name-of
make-duplicate-instance
make-space-instance
next-class-instance-number
Example
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]>
>
Note
The function make-space-instance provides a
clear and convenient shorthand for creating space instances.
The GBBopen Project
![]() | ![]() | ![]() | make-instance | ![]() |