org.cfpm.caves.za
Class CurrentTick

java.lang.Object
  extended by org.cfpm.caves.za.CurrentTick
All Implemented Interfaces:
jess.Userfunction

public class CurrentTick
extends java.lang.Object
implements jess.Userfunction

This class implements a user function in Jess. The parameterless function "current-tick" returns the current model tick, to be used on the RHS of rules. This way is more efficient than having the model in the LHS.

Author:
Ruth

Field Summary
(package private)  SouthAfricaModel model
          a reference to the model
 
Constructor Summary
CurrentTick(SouthAfricaModel model)
          Creates the user function with the given model
 
Method Summary
 jess.Value call(jess.ValueVector vv, jess.Context c)
          calls the function with the given parameter and context from Jess.
 java.lang.String getName()
          returns the name of the function in Jess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

SouthAfricaModel model
a reference to the model

Constructor Detail

CurrentTick

public CurrentTick(SouthAfricaModel model)
Creates the user function with the given model

Parameters:
model - the model
Method Detail

getName

public java.lang.String getName()
returns the name of the function in Jess

Specified by:
getName in interface jess.Userfunction

call

public jess.Value call(jess.ValueVector vv,
                       jess.Context c)
                throws jess.JessException
calls the function with the given parameter and context from Jess.

Specified by:
call in interface jess.Userfunction
Parameters:
vv - the list of parameters (ignored)
c - the Jess context (ignored)
Returns:
the current model tick
Throws:
jess.JessException