Class GenericActor<S extends GenericSimulation<S,A,C,D,DM,F,G>,A extends GenericActor<S,A,C,D,DM,F,G>,C extends GenericCondition<S,A,C,D,DM,F,G>,D extends GenericDomain<S,A,C,D,DM,F,G>,DM extends GenericDomainMember<S,A,C,D,DM,F,G>,F extends GenericFactory<S,A,C,D,DM,F,G>,G extends GenericGroup<S,A,C,D,DM,F,G>>
- All Implemented Interfaces:
CondObserver<C,
,A> NamedObjectOps
- Direct Known Subclasses:
Actor
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GenericActor
(S sim, String name, boolean intern) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addCondition
(C c) Associate a condition with an actor.boolean
Determine if this named object can be deleted.protected Object
clone()
Creates and returns a copy of this object.Get a set of conditions This does not include conditions associated with a domain.final boolean
delete()
Delete an object.final boolean
Determine if an object is being deleted.Get a set of the domains an actor's domain member is in.protected void
Respond to a message.protected void
Drain an actor's message queue.String[]
findMsgFrwdngInfo
(A dest, D domain) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericActor,GenericDomain)
.String[]
findMsgFrwdngInfo
(A dest, Set<CommDomainType> commDomainTypes) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericActor,Set)
.String[]
findMsgFrwdngInfo
(D domain) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericDomain)
.String[]
findMsgFrwdngInfo
(D dests, D domain) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericDomain,GenericDomain)
.String[]
findMsgFrwdngInfo
(D dests, Set<CommDomainType> commDomainTypes) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericDomain,Set)
.String[]
findMsgFrwdngInfo
(G dest, D domain) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericActor,GenericDomain)
.String[]
findMsgFrwdngInfo
(G dest, Set<CommDomainType> commDomainTypes) Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericGroup,Set)
.getChildDomains
(D ancestor) Get a set of the domains that the current actor is in with a common ancestor domain.boolean
Determine if condition-change notifications are queued.Get the condition-observer implementation for a condition observer.final String
getName()
Get an object's name.protected Simulation
Get the object namer for a named object.boolean
hasCondition
(C c) Determine if a condition observer has (is associated with) a condition.boolean
Determine if an actor's domain member is in a specific domain.final boolean
Determine if an object has been deleted.boolean
Determine if an object is interned in a object namer's tables.boolean
joinDomain
(D d) Join a domain.boolean
joinDomain
(D d, boolean trackConditions) Join a domain, specifying whether to track conditions.boolean
leaveDomain
(D d) Leave a domain.protected void
onConditionChange
(C condition, ConditionMode mode, SimObject source) Respond to a change in conditions This should be overridden by subclasses that react to the value of a condition.protected void
onConditionChange
(Map<C, ConditionInfo> conditionMap) Respond to a change in conditions This should be overridden by subclasses that react to the value of a condition if the default behavior - invoking onConditionChange(Condition,ConditionMode,SimObject) - is not appropriate.protected void
onDelete()
Complete the actions necessary to delete a named object.void
printConfiguration
(String iPrefix, String prefix, boolean printName, PrintWriter out) Print this simulation object's configuration.boolean
removeCondition
(C c) Disassociate a condition with a condition observer.protected final boolean
Send a message to an actor using a default domain.protected final void
Send a message to an actor.protected final boolean
Send a message to an actor.protected final boolean
send
(Object msg, A dest, Set<CommDomainType> commDomainTypes) Send a message to an actor using a domain constrained by a set of communication-domain types to use.protected void
Send a message to all actors in a domain.protected final void
Send a message to all actors in a domain, using a specific domain for communication.protected void
send
(Object msg, D domain, Set<CommDomainType> commDomainTypes) Send a message to all actors in a domain, ignoring some domains.protected final boolean
Send a message to a group using a default domain.protected final void
Send a message to a group.protected final boolean
Send a message to a group given a domain.protected final boolean
send
(Object msg, G dest, Set<CommDomainType> commDomainTypes) Send a message to a group using a domain constrained by a set of communication-domain types to use.void
setConditionChangeQMode
(boolean value) Set whether condition-change notifications should be queued or sent immediately.protected void
setMessageQueueing
(boolean value) Configure actor so that incoming messages are queued.void
setSharedDomainMember
(DM sharedDomainMember) Configure a shared domain member.Methods inherited from class org.bzdev.drama.generic.GenericMsgRecipient
getGroups, inGroup, joinGroup, joinGroup, leaveGroup
Methods inherited from class org.bzdev.drama.generic.GenericTaskObject
cancelDefaultCall, cancelDefaultTask, defaultCall, defaultTask, scheduleDefaultCall, scheduleDefaultTask, scheduleDefaultTask
Methods inherited from class org.bzdev.drama.generic.GenericSimObject
getSimulation, printState
Methods inherited from class org.bzdev.devqsim.SimObject
addSimulationListener, addTraceSet, bindCallable, bindCallable, bindCallable, bindCallable, bindRunnable, bindRunnable, bindRunnable, bindRunnable, callableObject, callableScript, callScriptFunction, callScriptMethod, clearTraceSets, evalScript, getEventListenerList, getScriptObject, getTraceSets, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printState, printState, printState, printState, printState, printState, putScriptObject, removeSimulationListener, removeTraceSet, runnableObject, runnableScript, scheduleCall, scheduleCall, scheduleCall, scheduleCall, scheduleCallObject, scheduleScript, scheduleTask, scheduleTask, scheduleTask, scheduleTask, scheduleTaskObject, scheduleTaskScript, startImmediateTask, startImmediateTask, trace, trace, unscheduledTaskThread, unscheduledTaskThread, update, update, usesTraceSet
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bzdev.obnaming.NamedObjectOps
canDelete, delete, deletePending, getName, isDeleted, isInterned
-
Constructor Details
-
GenericActor
Constructor.- Parameters:
sim
- the simulationname
- the name of the actorintern
- true if the object can be looked up by using the methods inSimulation
; false otherwise.- Throws:
IllegalArgumentException
- typically means a name is already in use- See Also:
-
-
Method Details
-
getCondObserverImpl
Description copied from interface:CondObserver
Get the condition-observer implementation for a condition observer. This method is intended for use by classes in the org.bzdev.drama.generic package.- Specified by:
getCondObserverImpl
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Returns:
- the condition-observer implementation
-
addCondition
Associate a condition with an actor. This adds a condition independently from those associated with domains.- Specified by:
addCondition
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Parameters:
c
- the condition- Returns:
- true on success; false on failure
-
removeCondition
Disassociate a condition with a condition observer. This removes a condition independently from those associated with domains.- Specified by:
removeCondition
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Parameters:
c
- the condition- Returns:
- true on success; false on failure
-
hasCondition
Determine if a condition observer has (is associated with) a condition. This does not include conditions associated with a domain.- Specified by:
hasCondition
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Parameters:
c
- the condition- Returns:
- true if the condition observer has condition c; false otherwise
-
conditionSet
Get a set of conditions This does not include conditions associated with a domain.- Specified by:
conditionSet
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Returns:
- the set of conditions that are associated with this condition observer
-
setConditionChangeQMode
public void setConditionChangeQMode(boolean value) Set whether condition-change notifications should be queued or sent immediately. Setting this mode to true will improve performance when many conditions are changed at the same simulation time. If the mode is changed from true to false while there are some queued notifications, those will be forwarded. This does not apply to conditions associated with a domain.- Specified by:
setConditionChangeQMode
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Parameters:
value
- true if notifications should be queued; false if they should be sent immediately.
-
getConditionChangeQMode
public boolean getConditionChangeQMode()Determine if condition-change notifications are queued. This does not apply to conditions associated with a domain.- Specified by:
getConditionChangeQMode
in interfaceCondObserver<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>> - Returns:
- true if queued; false otherwise.
-
onDelete
protected void onDelete()Complete the actions necessary to delete a named object. A subclass that overrides this method must call super.onDelete() at some point to complete the object deletion. This may not be within the onDelete method of the subclass if the deletion must be delayed for some reason (e.g., until some processing that is in progress has been completed). Once called, the object will be removed from the object-namer's tables and the object will be marked as deleted, so in general cleanup actions by a subclass should occur before it calls super.onDelete().- Overrides:
onDelete
in classGenericMsgRecipient<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>, C extends GenericCondition<S, A, C, D, DM, F, G>, D extends GenericDomain<S, A, C, D, DM, F, G>, DM extends GenericDomainMember<S, A, C, D, DM, F, G>, F extends GenericFactory<S, A, C, D, DM, F, G>, G extends GenericGroup<S, A, C, D, DM, F, G>>
-
setMessageQueueing
protected void setMessageQueueing(boolean value) Configure actor so that incoming messages are queued. When the value transitions from true to false, the queue will be drained by calling drainMessageQueue().- Parameters:
value
- true if messages should be queued; false otherwise
-
drainMessageQueue
protected void drainMessageQueue()Drain an actor's message queue. This will process all messages that have been queued by calling the actor's doReceive method for each queued message. -
doReceive
Respond to a message. Subclasses should implement this method to perform any necessary processing in response to a message.- Parameters:
message
- the message just receivedsource
- the actor that originated the messagewereQueued
- true if the message was queued; false otherwise
-
send
Send a message to an actor.- Parameters:
msg
- the message to senddest
- the destination actordelay
- how many time units to wait before the message is processed by its destination
-
send
Send a message to a group. The group will then distribute the message to some group-specific subset of the group's members.- Parameters:
msg
- the message to senddest
- the destination groupdelay
- how many time units to wait before the message is processed by its destination
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericActor,GenericDomain)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument.- Parameters:
dest
- the destinationdomain
- the domain determining message delay, message handling, and what message filter (if any) to use- Returns:
- the names of the forwarding tables
-
send
Send a message to an actor. The message delay and any message filtering will be determined by the specified domain. If communication is not possible with the specified domain, no message will be sent. This actor or the destination must be members of the domain provided by the third argument.If sim is the simulation for this object, the implementation will call sim.findCommDomain(this,domain.getCommDomainTypeSet(), dest,domain) to provide an instance cdinfo of
CommDomainInfo
}. To compute a message delay, theGenericMsgFrwdngInfo
object for various domains will be used. These domains are taken from the set of domains starting at both cdinfo.getSourceDomain() and cdinfo.getDestDomain(), including sequences of parent domains and ending at cdinfo.getAncestorDomain().A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericActor,GenericDomain)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddest
- the destination actordomain
- the domain determining message delay, message handling, and what message filter (if any) to use- Returns:
- true if the message was sent; false if the message could not be sent
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericActor,GenericDomain)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument. A list of the names of theGenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericGroup,GenericDomain)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
dest
- the destinationdomain
- the domain determining message delay, message handling, and what message filter (if any) to use- Returns:
- the names of formatting tables
-
send
Send a message to a group given a domain. The message delay and any message filtering will be determined by the specified domain. The message will not be sent if the domain does not allow communication between the current actor and the destination group. This actor or the destination must be members of the domain provided by the third argument.If sim is the simulation for this object, the implementation will call sim.findCommDomain(this,domain.getCommDomainTypeSet(), dest,domain) to provide an instance cdinfo of
CommDomainInfo
}. To compute a message delay, theGenericMsgFrwdngInfo
object for various domains will be used. These domains are taken from the set of domains starting at both cdinfo.getSourceDomain() and cdinfo.getDestDomain(), including sequences of parent domains and ending at cdinfo.getAncestorDomain().A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericGroup,GenericDomain)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddest
- the destination groupdomain
- the domain determining message delay, message handling, and what message filter (if any) to use- Returns:
- true if the message was sent; false if the message could not be sent
-
send
Send a message to an actor using a default domain. The delay and any message filter will be determined by the domain chosen from those domains of which this actor is a member. The search is in the order given by the domains' priorities and the first match that allows communication between actors is chosen.This method calls send(msg, dest, (Set<CommDomainType>)null).
- Parameters:
msg
- the message to senddest
- the destination actor- Returns:
- true on success; false if the message cannot be sent
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericActor,Set)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument.- Parameters:
dest
- the destinationcommDomainTypes
- the types of domains to allow; null if any domain is acceptable- Returns:
- the names of the forwarding tables
-
send
Send a message to an actor using a domain constrained by a set of communication-domain types to use. The delay and any message filter will be determined by the domain chosen from those domains of which this actor is a member. The search is in the order given by the domains' priorities and the first match that allows communication between actors is chosen. In some simulation flavors, domains may represent constraints that must be satisfied in order to successfully send a message. If a message filter causes a message to be dropped, this method will return true - a return value of false indicates that the destination is not reachable, not that there has been a transient failure.If sim is the simulation for this object, the implementation will call sim.findCommDomain(this,commDomainTypes, dest,domain) to provide an instance cdinfo of
CommDomainInfo
}. To compute a message delay, theGenericMsgFrwdngInfo
object for various domains will be used. These domains are taken from the set of domains starting at both cdinfo.getSourceDomain() and cdinfo.getDestDomain(), including sequences of parent domains and ending at cdinfo.getAncestorDomain().A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericActor,Set)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddest
- the destination actorcommDomainTypes
- the types of domains to allow; null if any domain is acceptable- Returns:
- true on success; false if the message cannot be sent
-
send
Send a message to a group using a default domain. The delay and any message filter will be determined by the domain chosen from those domains of which this actor is a member. The search is in the order given by the domains' priorities and the first match that allows communication between actors is chosen.This method just calls send(msg, dest, (Set<CommDomainType>)null).
- Parameters:
msg
- the message to senddest
- the destination group- Returns:
- true on success; false if the message cannot be sent
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericGroup,Set)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument.- Parameters:
dest
- the destinationcommDomainTypes
- the types of domains to allow; null if any domain is acceptable- Returns:
- the names of the forwarding tables
-
send
Send a message to a group using a domain constrained by a set of communication-domain types to use. The delay and any message filter will be determined by the domain chosen from those domains of which this actor is a member. The search is in the order given by the domains' priorities and the first match that allows communication between actors is chosen. If a message filter causes a message to be dropped, this method will return true - a return value of false indicates that the destination is not reachable, not that there has been a transient failure.If sim is the simulation for this object, the implementation will call sim.findCommDomain(this,commDomainTypes, dest,domain) to provide an instance cdinfo of
CommDomainInfo
}. To compute a message delay, theGenericMsgFrwdngInfo
object for various domains will be used. These domains are taken from the set of domains starting at both cdinfo.getSourceDomain() and cdinfo.getDestDomain(), including sequences of parent domains and ending at cdinfo.getAncestorDomain().A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericGroup,Set)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddest
- the destination groupcommDomainTypes
- the types of domains to allow; null if any domain is acceptable- Returns:
- true on success; false if the message cannot be sent
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericDomain)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument.- Parameters:
domain
- the domain specifying the recipient actors- Returns:
- the names of the forwarding tables
-
send
Send a message to all actors in a domain. The delay and any message filter will be determined by the domain chosen from those domains of which this actor is a member. The search is in the order given by the domains' priorities and the first match that allows communication between actors is chosen.The message will not be delivered to the source (the current actor). Otherwise this is equivalent to calling send(msg,actor) repeatedly for each actor in the domain specified by the second argument.
A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericDomain)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddomain
- the domain specifying the recipient actors
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericDomain,GenericDomain)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument.- Parameters:
dests
- the domain specifying the recipient actorsdomain
- the domain determining message delay, message handling, and what message filter (if any) to use- Returns:
- the names of the forwarding tables
-
send
Send a message to all actors in a domain, using a specific domain for communication. The message delay and any message filtering will be determined by the specified domain.The message will not be delivered to the source (the current actor). Otherwise it is equivalent to calling send(msg, act, domain) where act is each actor in the domain dests.
A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericDomain,GenericDomain)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddests
- the destination domaindomain
- the domain determining message delay, message handling, and what message filter (if any) to use
-
findMsgFrwdngInfo
Find the names of the forwarding tables (MsgFrwdngInfo) used by a call tosend(Object,GenericDomain,Set)
. This method is intended primarily as a debugging aid. It can be used to determine which subclasses ofGenericMsgFrwdngInfo
to instrument.- Parameters:
dests
- the domain specifying the recipient actorscommDomainTypes
- the types of domains to allow; null if any domain is acceptable- Returns:
- the names of the forwarding tables
-
send
Send a message to all actors in a domain, ignoring some domains. The delay and any message filter will be determined by the domain chosen from those domains of which this actor is a member. The search is in the order given by the domains' priorities and the first match that allows communication between actors is chosen. In some simulation flavors, domains may represent constraints that must be satisfied in order to successfully send a message. Ignoring all of an actor's domains at a given priority level will remove that constraint in this case.The message will not be delivered to the source (the current actor). Otherwise it is equivalent to calling send(msg, act, domain,commDomainTypes) where act is each actor in the domain dests.
A list of the names of the
GenericMsgFrwdngInfo
objects used can be generated by callingfindMsgFrwdngInfo(GenericDomain,Set)
. This list is useful for debugging as it can determine which objects to instrument.- Parameters:
msg
- the message to senddomain
- the domain specifying the recipient actorscommDomainTypes
- the types of domains to allow; null if any domain is acceptable
-
getChildDomains
Get a set of the domains that the current actor is in with a common ancestor domain. The iterator for the returned set will return domains in the order set by domain-specific criteria.- Parameters:
ancestor
- the ancestor domain- Returns:
- a set of domains that the current actor is in and that have the specified ancestor
-
joinDomain
Join a domain. Conditions will not be tracked. The implementation callsjoinDomain(d, false)
so normally this method should not be overridden.- Parameters:
d
- the domain to join- Returns:
- true on success; false on failure, including having already joined
-
joinDomain
Join a domain, specifying whether to track conditions.- Parameters:
d
- the domain to jointrackConditions
- true if the actor should be notified when conditions that d has have changed; false otherwise- Returns:
- true on success; false on failure, including having already joined by the actor or a shared domain member
-
leaveDomain
Leave a domain.- Parameters:
d
- the domain to leave- Returns:
- true on success; false on failure
-
inDomain
Determine if an actor's domain member is in a specific domain.- Parameters:
d
- the domain- Returns:
- true if the domain member is in the domain; false if not
-
domainSet
Get a set of the domains an actor's domain member is in.- Returns:
- a set containing the domains.
-
onConditionChange
Respond to a change in conditions This should be overridden by subclasses that react to the value of a condition. The third argument (source) depends on the condition mode:- for a mode of
CONDITION_DELETED
, the third argument is the condition that was deleted (the same as the first argument). - for a mode of
DOMAIN_ADDED_CONDITION
, the third argument is the domain that added the condition. - for a mode of
DOMAIN_REMOVED_CONDITION
, the third argument is the domain that added the condition. - for a mode of
OBSERVER_ADDED_CONDITION
, the third argument is the condition observer (e.g., an actor or group) that added a condition. - for a mode of
OBSERVER_REMOVED_CONDITION
, the third argument is the condition observer (e.g., an actor or group) that added a condition. - for a mode of
OBSERVER_JOINED_DOMAIN
, the third argument is the domain an actor left - for a mode of
OBSERVER_LEFT_DOMAIN
, the third argument is the domain that an actor left. - for a mode of
OBSERVER_NOTIFIED
, the third argument is the condition that was changed (the same as the first argument).
- Parameters:
condition
- the condition that changedmode
- the condition modesource
- the object responsible for the change- See Also:
- for a mode of
-
onConditionChange
Respond to a change in conditions This should be overridden by subclasses that react to the value of a condition if the default behavior - invoking onConditionChange(Condition,ConditionMode,SimObject) - is not appropriate.- Parameters:
conditionMap
- a map keyed by conditions that changed.
-
printConfiguration
Print this simulation object's configuration. Documentation for the use of this method is provided by the documentation for theSimObject
methodSimObject.printConfiguration(String,String,boolean,PrintWriter)
. When the thirs argument has a value of true, the object name and class name will be printed in a standard format with its indentation provided by the iPrefix argument. In addition, the configuration that is printed includes the following items.Defined in
GenericMsgRecipient
:- the groups this object has joined.
Defined in
GenericActor
:- the domains this object has joined.
- the conditions this object explicitly observes.
- Overrides:
printConfiguration
in classGenericMsgRecipient<S extends GenericSimulation<S,
A, C, D, DM, F, G>, A extends GenericActor<S, A, C, D, DM, F, G>, C extends GenericCondition<S, A, C, D, DM, F, G>, D extends GenericDomain<S, A, C, D, DM, F, G>, DM extends GenericDomainMember<S, A, C, D, DM, F, G>, F extends GenericFactory<S, A, C, D, DM, F, G>, G extends GenericGroup<S, A, C, D, DM, F, G>> - Parameters:
iPrefix
- the prefix to use for an initial line when printName is true with null treated as an empty stringprefix
- a prefix string (typically whitespace) to put at the start of each line other than the initial line that is printed when printName is trueprintName
- requests printing the name of an objectout
- the output print writer
-
clone
Creates and returns a copy of this object. This method will throw the exception CloneNotSupportedException if the object is interned.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
- a clone could not be created- See Also:
-
isInterned
public boolean isInterned()Determine if an object is interned in a object namer's tables.- Specified by:
isInterned
in interfaceNamedObjectOps
- Returns:
- true if the object is interned; false if not
-
getObjectNamer
Get the object namer for a named object.- Returns:
- the object namer for this named object
-
getName
Get an object's name.- Specified by:
getName
in interfaceNamedObjectOps
- Returns:
- the name of the object
-
canDelete
public boolean canDelete()Determine if this named object can be deleted. A named object can be deleted if the method delete has not been called and if the object is not in a state that prevents the object from being deleted. Subclasses that override this method must call canDelete() for their superclasses and return false if the superclass' canDelete method returns false. The default method returns true if delete() has not been called and returned true.- Specified by:
canDelete
in interfaceNamedObjectOps
- Returns:
- true if this object can be deleted; false otherwise
-
delete
public final boolean delete()Delete an object. An object can only be deleted once. If this method returns true, the object (if interned) will have been removed from the object namer tables.The implementations provided by
DefaultNamedObect
and generated because of a@NamedObject
annotation provide a protected method named onDelete. A subclass that overrides onDelete() must call the onDelete method of its superclass after it's onDelete method has been called and any cleanup actions performed. In some cases, this may happen at a later time (e.g., if a thread is used for some of the cleanup operations or if it is otherwise necessary to wait).- Specified by:
delete
in interfaceNamedObjectOps
- Returns:
- true if the deletion request was accepted; false otherwise
-
isDeleted
public final boolean isDeleted()Determine if an object has been deleted. An object is deleted if the method delete() has been called and returned true.- Specified by:
isDeleted
in interfaceNamedObjectOps
- Returns:
- true if deleted; false otherwise
-
deletePending
public final boolean deletePending()Determine if an object is being deleted. An deletion is pending if the method delete() has been called and returned true but the deletion has not been completed.- Specified by:
deletePending
in interfaceNamedObjectOps
- Returns:
- true if deletion is pending; false otherwise
-