public class Actor extends Id
Modifier and Type | Class and Description |
---|---|
static class |
Actor.ActorType
If an actor is dataflow actor or inserted communication actor.
|
Modifier and Type | Field and Description |
---|---|
private Actor.ActorType |
actorType
Type of an actor
|
private boolean |
auto
true for purely analytical actors
|
private int |
executionTime
Execution time of an actor.
|
private java.util.LinkedList<Channel.Link> |
links_IN
Links connected to input ports of an actor.
|
private java.util.LinkedList<Channel.Link> |
links_OUT
Links connected to output ports of an actor.
|
Constructor and Description |
---|
Actor()
Initialize actor to data flow actor by default.
|
Actor(Actor otherActor)
Create a copy of other actor.
|
Actor(java.lang.String function,
java.lang.String name,
int execTime,
Actor.ActorType actorType)
Initialize an actor
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
bind(Channel.Link link)
connect actor to one side (link) of a channel
(called by the channel)
|
void |
dump()
debug: print some details about the actor
|
Actor.ActorType |
getActorType()
Get Actor type.
|
java.util.HashSet<Channel> |
getAllChannels()
Gets a set of all incoming and outgoing channels connected to this actor.
|
java.util.HashSet<Channel.Link> |
getAllLinks()
Gets a set of all incoming and outgoing links connected to this actor.
|
boolean |
getAutoFlag()
get the status of auto flag, indicating purely analytical actors
|
java.util.HashSet<Channel> |
getChannels(Port.DIR direction)
Get channels at the ports of this actor in a given direction.
|
int |
getExecTime()
Gets execution time of the actor.
|
java.util.HashSet<Channel.Link> |
getLinks(Port.DIR dir)
Get links at the ports of this actor in a given direction.
|
private java.util.LinkedList<Channel.Link> |
linkList(Port.DIR dir)
access the links bound to the given actor IN or OUT
|
int |
numIncomingLinks()
Gets number of incoming links.
|
int |
numOutgoingLinks()
Gets number of outgoing links.
|
void |
setActorType(Actor.ActorType actorType)
Set Actor type.
|
void |
setAutoFlag()
set auto flag for purely analytical actors
|
void |
setExecTime(int time)
Sets execution time of the actor
|
java.lang.String |
toString() |
void |
unbind(Channel.Link lnk) |
private Actor.ActorType actorType
private int executionTime
private java.util.LinkedList<Channel.Link> links_IN
private java.util.LinkedList<Channel.Link> links_OUT
private boolean auto
public Actor(Actor otherActor)
otherActor
- all fields are copied from other actor.public Actor()
public Actor(java.lang.String function, java.lang.String name, int execTime, Actor.ActorType actorType)
function
- Function which an actor will execute, this is not a strict fieldname
- Name of the actorexecTime
- execution time of the actor.actorType
- type of actor : data flow or communicationpublic int numIncomingLinks()
public int numOutgoingLinks()
public int getExecTime()
public void setExecTime(int time)
time
- execution time of the actorpublic void unbind(Channel.Link lnk)
lnk
- void bind(Channel.Link link)
link
- private java.util.LinkedList<Channel.Link> linkList(Port.DIR dir)
dir
- directionpublic void setAutoFlag()
public boolean getAutoFlag()
public java.util.HashSet<Channel> getChannels(Port.DIR direction)
direction
- port directionpublic java.util.HashSet<Channel> getAllChannels()
public java.util.HashSet<Channel.Link> getAllLinks()
public java.util.HashSet<Channel.Link> getLinks(Port.DIR dir)
dir
- port directionpublic void dump()
public Actor.ActorType getActorType()
public void setActorType(Actor.ActorType actorType)
actorType
- Actor type : dataflow or communication