aa.application.AdaptiveQuad
Class QuadActor_Res

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

public class QuadActor_Res
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)  long height
           
(package private)  java.lang.String meth
           
(package private)  int numResponses
           
(package private)  double partialResponse
           
(package private)  java.lang.Double tolerance
           
 
Fields inherited from class aa.core.Actor
m_athread
 
Constructor Summary
QuadActor_Res(ActorName p_anClient, java.lang.String p_strMeth, java.lang.Double p_douTolerance, ActorName p_anFacili, java.lang.Long p_lHeight)
           
QuadActor_Res(java.lang.Double p_douTolerance, ActorName p_anClient, ActorName p_anFacili, java.lang.Long p_lHeight)
           
QuadActor_Res(java.lang.Double p_douTolerance, ActorName p_anFacili, java.lang.Long p_lHeight)
          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

height

long height

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
Constructor Detail

QuadActor_Res

public QuadActor_Res(java.lang.Double p_douTolerance,
                     ActorName p_anFacili,
                     java.lang.Long p_lHeight)
Creates a new instance of QuadWorker


QuadActor_Res

public QuadActor_Res(java.lang.Double p_douTolerance,
                     ActorName p_anClient,
                     ActorName p_anFacili,
                     java.lang.Long p_lHeight)

QuadActor_Res

public QuadActor_Res(ActorName p_anClient,
                     java.lang.String p_strMeth,
                     java.lang.Double p_douTolerance,
                     ActorName p_anFacili,
                     java.lang.Long p_lHeight)
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)
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


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.