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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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 functiondouble
evaluate
(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:ArithFunction
returns the name of the function- Specified by:
getName
in interfaceArithFunction
-
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 interfaceArithFunction
-
evaluate
Description copied from interface:ArithFunction
evaluates/computes the function based on the args- Specified by:
evaluate
in interfaceArithFunction
- Throws:
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 interfaceArithFunction
-
toString
-