aa.application.AdaptiveQuad
Class QuadActor_RemoteRes

java.lang.Object
  extended byaa.core.Actor
      extended byaa.application.AdaptiveQuad.QuadActor_RemoteRes
All Implemented Interfaces:
java.io.Serializable

public class QuadActor_RemoteRes
extends Actor

Author:
xinghuizhao
See Also:
Serialized Form

Field Summary
(package private)  ActorName client
          The first response we have received from a child fib actor.
(package private)  ActorName facili
           
(package private)  java.lang.String meth
           
(package private)  int numResponses
           
(package private)  double partialResponse
           
(package private)  ActorName remoteFaci
           
(package private)  java.lang.String remoteIP
           
(package private)  java.lang.Double tolerance
           
 
Fields inherited from class aa.core.Actor
m_athread
 
Constructor Summary
QuadActor_RemoteRes(ActorName p_anClient, java.lang.String p_strMeth, java.lang.Double p_douTolerance, ActorName p_anFacili, java.lang.String p_strIP)
           
QuadActor_RemoteRes(ActorName p_anClient, java.lang.String p_strMeth, java.lang.Double p_douTolerance, java.lang.String p_strIP)
           
QuadActor_RemoteRes(java.lang.Double p_douTolerance, ActorName p_anClient, ActorName p_anFacili, ActorName p_anRemoteFaci)
           
QuadActor_RemoteRes(java.lang.Double p_douTolerance, ActorName p_anClient, ActorName p_anFacili, java.lang.String p_strIP)
           
QuadActor_RemoteRes(java.lang.Double p_douTolerance, ActorName p_anFacili, java.lang.String p_strIP)
          Creates a new instance of QuadWorker
 
Method Summary
 double divideSum(java.lang.Double a, java.lang.Double b)
          Calculate the sum of areas of two sub trapezoids
 double error(java.lang.Double a, java.lang.Double b)
           
 double func(double x)
          The function
 void quadrature(java.lang.Double a, java.lang.Double b, ActorName p_anClient, java.lang.String p_strMeth)
          This method is called to do the quadrature computation a: lower bound b: upper bound tolerance: the error tolerance p_anClient: the actor which is suppose to receive result from this actor p_strMeth: the name of the method to calculate result in client actor
 void result(java.lang.Double p_douVal)
          This method is called from another child actor to pass a partial result.
 void setFaci(ActorName p_anNewFaci)
           
 double trapezoid(java.lang.Double a, java.lang.Double b)
          Calculate the area of a trapezoid
 
Methods inherited from class aa.core.Actor
become, become, become, become, become, become, become, become, become, become, become, becomeActor, call, call, call, call, call, call, call, call, call, call, call, callMessage, create, create, create, create, create, create, create, create, create, create, create, createActor, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemoteActor, destroy, echo, getActorName, getDefaultDirectoryManager, getDefaultDirectoryManager, getLastErrorMessage, migrate, print, printLastErrorMessage, println, send, send, send, send, send, send, send, send, send, send, send, sendMessage, setErrorMessage, uninit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numResponses

int numResponses

partialResponse

double partialResponse

tolerance

java.lang.Double tolerance

facili

ActorName facili

client

ActorName client
The first response we have received from a child fib actor. We save this value until we receive the second response, and send our client the sum of both values


meth

java.lang.String meth

remoteIP

java.lang.String remoteIP

remoteFaci

ActorName remoteFaci
Constructor Detail

QuadActor_RemoteRes

public QuadActor_RemoteRes(java.lang.Double p_douTolerance,
                           ActorName p_anFacili,
                           java.lang.String p_strIP)
Creates a new instance of QuadWorker


QuadActor_RemoteRes

public QuadActor_RemoteRes(java.lang.Double p_douTolerance,
                           ActorName p_anClient,
                           ActorName p_anFacili,
                           java.lang.String p_strIP)

QuadActor_RemoteRes

public QuadActor_RemoteRes(java.lang.Double p_douTolerance,
                           ActorName p_anClient,
                           ActorName p_anFacili,
                           ActorName p_anRemoteFaci)

QuadActor_RemoteRes

public QuadActor_RemoteRes(ActorName p_anClient,
                           java.lang.String p_strMeth,
                           java.lang.Double p_douTolerance,
                           ActorName p_anFacili,
                           java.lang.String p_strIP)

QuadActor_RemoteRes

public QuadActor_RemoteRes(ActorName p_anClient,
                           java.lang.String p_strMeth,
                           java.lang.Double p_douTolerance,
                           java.lang.String p_strIP)
Method Detail

setFaci

public void setFaci(ActorName p_anNewFaci)

quadrature

public void quadrature(java.lang.Double a,
                       java.lang.Double b,
                       ActorName p_anClient,
                       java.lang.String p_strMeth)
                throws CommunicationException
This method is called to do the quadrature computation a: lower bound b: upper bound tolerance: the error tolerance p_anClient: the actor which is suppose to receive result from this actor p_strMeth: the name of the method to calculate result in client actor

Throws:
CommunicationException

func

public double func(double x)
The function


trapezoid

public double trapezoid(java.lang.Double a,
                        java.lang.Double b)
Calculate the area of a trapezoid


divideSum

public double divideSum(java.lang.Double a,
                        java.lang.Double b)
Calculate the sum of areas of two sub trapezoids


error

public double error(java.lang.Double a,
                    java.lang.Double b)

result

public void result(java.lang.Double p_douVal)
This method is called from another child actor to pass a partial result. We wait until we have two such results, add them, and return the result to client.