jadex.micro.examples.mandelbrot
Class CalculateAgent

java.lang.Object
  extended by jadex.micro.MicroAgent
      extended by jadex.micro.examples.mandelbrot.CalculateAgent
All Implemented Interfaces:
IInternalAccess, IMicroAgent

public class CalculateAgent
extends MicroAgent

Calculate agent allows calculating the colors of an area using a calculate service.


Nested Class Summary
 
Nested classes/interfaces inherited from class jadex.micro.MicroAgent
MicroAgent.TimerWrapper
 
Field Summary
protected  boolean hadjob
          Flag indicating that the agent had a job.
protected  int progress
          Progress of the current job.
protected  Object taskid
          Id of the current job.
 
Fields inherited from class jadex.micro.MicroAgent
interpreter, longtime, timers
 
Constructor Summary
CalculateAgent()
           
 
Method Summary
 void agentCreated()
          Called once after agent creation.
 void executeBody()
          Execute the body.
static MicroAgentMetaInfo getMetaInfo()
          Get the meta information about the agent.
 int getProgress()
          Get the current progress.
 Object getTaskId()
          Get the current task id.
 boolean isHadJob()
          Get the hadjob.
 void setHadJob(boolean hadjob)
          Set the hadjob.
 void setProgress(int progress)
          Set the current progress.
 void setTaskId(Object taskid)
          Set the current task id.
 
Methods inherited from class jadex.micro.MicroAgent
addComponentListener, addDirectService, addService, agentKilled, createComponentIdentifier, createComponentIdentifier, createComponentIdentifier, createReply, createResultListener, createServiceContainer, getAgentAdapter, getAgentName, getArgument, getArguments, getChildren, getComponentIdentifier, getConfiguration, getExternalAccess, getLogger, getModel, getParent, getServiceProvider, getTime, init, isAtBreakpoint, killAgent, killComponent, messageArrived, removeComponentListener, removeService, scheduleStep, sendMessage, setResultValue, waitFor, waitForTick
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hadjob

protected boolean hadjob
Flag indicating that the agent had a job.


taskid

protected Object taskid
Id of the current job.


progress

protected int progress
Progress of the current job.

Constructor Detail

CalculateAgent

public CalculateAgent()
Method Detail

agentCreated

public void agentCreated()
Called once after agent creation.

Specified by:
agentCreated in interface IMicroAgent
Overrides:
agentCreated in class MicroAgent

executeBody

public void executeBody()
Execute the body.

Specified by:
executeBody in interface IMicroAgent
Overrides:
executeBody in class MicroAgent

setHadJob

public void setHadJob(boolean hadjob)
Set the hadjob.

Parameters:
hadjob - The hadjob to set.

isHadJob

public boolean isHadJob()
Get the hadjob.

Returns:
The hadjob.

getTaskId

public Object getTaskId()
Get the current task id.


setTaskId

public void setTaskId(Object taskid)
Set the current task id.


getProgress

public int getProgress()
Get the current progress.


setProgress

public void setProgress(int progress)
Set the current progress.


getMetaInfo

public static MicroAgentMetaInfo getMetaInfo()
Get the meta information about the agent.



Copyright © 2010. All Rights Reserved.