org.dyncle
Class ComponentBehaviour
java.lang.Object
jade.core.behaviours.Behaviour
jade.core.behaviours.SimpleBehaviour
org.dyncle.ComponentBehaviour
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ADTypeComponent, ATypeComponent, ChargeBattery, CTypeComponent, DiscoverObjectByRandomWalk, DiscoverObjectUsingCamera, Find, MoveTo, MoveTo, PickUpDust, SweepDust, UnloadDust
public abstract class ComponentBehaviour
- extends jade.core.behaviours.SimpleBehaviour
A behavior corresponding to a component in design phase.
- Version:
- 1.4: add "priority"
- Author:
- Hiroyuki NAKAGAWA
- See Also:
- Serialized Form
Fields inherited from class jade.core.behaviours.Behaviour |
STATE_BLOCKED, STATE_READY, STATE_RUNNING |
Methods inherited from class jade.core.behaviours.SimpleBehaviour |
reset |
Methods inherited from class jade.core.behaviours.Behaviour |
actionWrapper, block, block, getBehaviourName, getDataStore, getExecutionState, getRestartCounter, handleRestartEvent, isRunnable, onEnd, onStart, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mode
public Mode mode
name
public java.lang.String name
serviceType
public java.lang.String serviceType
priority
public int priority
ComponentBehaviour
public ComponentBehaviour(SASystem a)
- This constructor sets the owner agent for this behavior.
- Parameters:
a
- The agent this behavior belongs to.
ComponentBehaviour
public ComponentBehaviour(SASystem a,
java.lang.String name,
java.lang.String serviceType)
- This constructor sets the component's name and service type.
- Parameters:
a
- The agent this behavior belongs to.name
- component's name.serviceType
- components's service type.
action
public final void action()
- Specified by:
action
in class jade.core.behaviours.Behaviour
perform
public abstract void perform()
done
public boolean done()
- Specified by:
done
in class jade.core.behaviours.Behaviour
activate
public void activate()
passivate
public void passivate()
terminate
public void terminate()
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
getServiceType
public java.lang.String getServiceType()
setServiceType
public void setServiceType(java.lang.String serviceType)
getPriority
public int getPriority()
- Return priority of this component.
This priority corresponds to that of the control loop.
- Returns:
addPort
public void addPort(Port<?> port)
connectPorts
public void connectPorts(Port<?> p1,
Port<?> p2)
- Connects two ports.
If one provides exclusive service, it determines
whether it should connect or not by comparing the priorities.
- Parameters:
p1
- own port (required Port)p2
- partner's port (provided Port)
disconnectPorts
public void disconnectPorts(Port<?> p1,
Port<?> p2)
- Disconnects ports.
- Parameters:
p1
- own port (required Port)p2
- partner's port (provided Port)
getRequiredPorts
public java.util.ArrayList<Port<?>> getRequiredPorts()
getProvidedPorts
public java.util.ArrayList<Port<?>> getProvidedPorts()