Package jason.asSemantics
Class DefaultArithFunction
java.lang.Object
jason.asSemantics.DefaultArithFunction
- All Implemented Interfaces:
ArithFunction,Serializable
- Direct Known Subclasses:
Abs,acos,asin,atan,Average,ceil,cos,Count,e,floor,Length,log,Max,mean,median,Min,pi,Random,Round,RuleToFunction,sin,Sqrt,StdDev,Sum,tan,time
Useful default implementation of all methods of ArithFunction interface.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanreturns true if the arguments of the function can be unground (as in .count)booleancheckArity(int a) returns true if a is a good number of arguments for the functiondoubleevaluate(TransitionSystem ts, Term[] args) evaluates/computes the function based on the argsgetName()returns the name of the functiontoString()
-
Constructor Details
-
DefaultArithFunction
public DefaultArithFunction()
-
-
Method Details
-
getName
Description copied from interface:ArithFunctionreturns the name of the function- Specified by:
getNamein interfaceArithFunction
-
checkArity
public boolean checkArity(int a) Description copied from interface:ArithFunctionreturns true if a is a good number of arguments for the function- Specified by:
checkArityin interfaceArithFunction
-
evaluate
Description copied from interface:ArithFunctionevaluates/computes the function based on the args- Specified by:
evaluatein interfaceArithFunction- Throws:
Exception
-
allowUngroundTerms
public boolean allowUngroundTerms()Description copied from interface:ArithFunctionreturns true if the arguments of the function can be unground (as in .count)- Specified by:
allowUngroundTermsin interfaceArithFunction
-
toString
-