Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mandarax.eca.example
Class PortfolioAgent  view PortfolioAgent download PortfolioAgent.java

java.lang.Object
  extended byorg.mandarax.eca.example.PortfolioAgent
All Implemented Interfaces:
org.mandarax.eca.EventListener, ExampleLog

public class PortfolioAgent
extends java.lang.Object
implements org.mandarax.eca.EventListener, ExampleLog

An agent using a set of ECA rules.


Field Summary
(package private) static Predicate doAction
           
private  org.mandarax.eca.EventSource eventSource
           
private  Function getPriceChange
           
private  Predicate isCritical
           
private  Predicate isRisk
           
private  org.mandarax.kernel.KnowledgeBase kb
           
private  PortfolioAction lastAction
           
private  Derivation lastDerivation
           
private  Portfolio portfolio
           
private  java.beans.PropertyChangeSupport propertyChangeSupport
           
private  java.lang.Object target
           
static java.lang.String XML_SOURCE
           
 
Fields inherited from interface org.mandarax.eca.example.ExampleLog
LOG_EXAMPLE
 
Constructor Summary
PortfolioAgent()
          Constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void consume(org.mandarax.eca.Event e)
          Event listener method.
 org.mandarax.eca.EventSource getEventSource()
          Returns the eventSource.
 org.mandarax.kernel.KnowledgeBase getKb()
          Returns the kb.
 PortfolioAction getLastAction()
          Returns the lastAction.
 Derivation getLastDerivation()
          Returns the lastDerivation.
 Portfolio getPortfolio()
          Returns the portfolio.
 java.lang.Object getTarget()
          Returns the action target.
private  void initialize()
          Initialize the agent.
private  void initKB()
          Initialize the knowledge base.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void setLastAction(PortfolioAction lastAction)
          Sets the lastAction.
 void setLastDerivation(Derivation lastDerivation)
          Sets the lastDerivation.
 void setTarget(java.lang.Object target)
          Sets the action target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_SOURCE

public static final java.lang.String XML_SOURCE
See Also:
Constant Field Values

kb

private org.mandarax.kernel.KnowledgeBase kb

eventSource

private org.mandarax.eca.EventSource eventSource

portfolio

private Portfolio portfolio

doAction

static Predicate doAction

isCritical

private Predicate isCritical

isRisk

private Predicate isRisk

getPriceChange

private Function getPriceChange

target

private java.lang.Object target

lastAction

private PortfolioAction lastAction

lastDerivation

private Derivation lastDerivation

propertyChangeSupport

private transient java.beans.PropertyChangeSupport propertyChangeSupport
Constructor Detail

PortfolioAgent

public PortfolioAgent()
Constructor.

Method Detail

initialize

private void initialize()
Initialize the agent.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

consume

public void consume(org.mandarax.eca.Event e)
Event listener method.

Specified by:
consume in interface org.mandarax.eca.EventListener

initKB

private void initKB()
Initialize the knowledge base.


getTarget

public java.lang.Object getTarget()
Returns the action target.


setTarget

public void setTarget(java.lang.Object target)
Sets the action target.


getLastAction

public PortfolioAction getLastAction()
Returns the lastAction.


getLastDerivation

public Derivation getLastDerivation()
Returns the lastDerivation.


setLastAction

public void setLastAction(PortfolioAction lastAction)
Sets the lastAction.


setLastDerivation

public void setLastDerivation(Derivation lastDerivation)
Sets the lastDerivation.


getKb

public org.mandarax.kernel.KnowledgeBase getKb()
Returns the kb.


getEventSource

public org.mandarax.eca.EventSource getEventSource()
Returns the eventSource.


getPortfolio

public Portfolio getPortfolio()
Returns the portfolio.