jason.asSemantics
Class DefaultArithFunction

Package class diagram package DefaultArithFunction
java.lang.Object
  extended by jason.asSemantics.DefaultArithFunction
All Implemented Interfaces:
ArithFunction, java.io.Serializable
Direct Known Subclasses:
Abs, Average, ceil, Count, e, floor, Length, log, Max, Min, pi, Random, Round, RuleToFunction, Sqrt, StdDev, Sum, time

public abstract class DefaultArithFunction
extends java.lang.Object
implements ArithFunction, java.io.Serializable

Useful default implementation of all methods of ArithFunction interface.

See Also:
Serialized Form

Constructor Summary
DefaultArithFunction()
           
 
Method Summary
 boolean allowUngroundTerms()
          returns true if the arguments of the function can be unground (as in .count)
 boolean checkArity(int a)
          returns true if a is a good number of arguments for the function
 double evaluate(TransitionSystem ts, Term[] args)
          evaluates/computes the function based on the args
 java.lang.String getName()
          returns the name of the function
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultArithFunction

public DefaultArithFunction()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ArithFunction
returns the name of the function

Specified by:
getName in interface ArithFunction

checkArity

public boolean checkArity(int a)
Description copied from interface: ArithFunction
returns true if a is a good number of arguments for the function

Specified by:
checkArity in interface ArithFunction

evaluate

public double evaluate(TransitionSystem ts,
                       Term[] args)
                throws java.lang.Exception
Description copied from interface: ArithFunction
evaluates/computes the function based on the args

Specified by:
evaluate in interface ArithFunction
Throws:
java.lang.Exception

allowUngroundTerms

public boolean allowUngroundTerms()
Description copied from interface: ArithFunction
returns true if the arguments of the function can be unground (as in .count)

Specified by:
allowUngroundTerms in interface ArithFunction

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object