Package jason.asSemantics
Class DefaultArithFunction
java.lang.Object
jason.asSemantics.DefaultArithFunction
- All Implemented Interfaces:
ArithFunction
,java.io.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
public abstract class DefaultArithFunction extends java.lang.Object implements ArithFunction, java.io.Serializable
Useful default implementation of all methods of ArithFunction interface.
- Author:
- Jomi
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description DefaultArithFunction()
-
Method Summary
Modifier and Type Method Description 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 functiondouble
evaluate(TransitionSystem ts, Term[] args)
evaluates/computes the function based on the argsjava.lang.String
getName()
returns the name of the functionjava.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
-
Constructor Details
-
DefaultArithFunction
public DefaultArithFunction()
-
-
Method Details
-
getName
public java.lang.String 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:
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 interfaceArithFunction
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-