Class median

java.lang.Object
All Implemented Interfaces:
ArithFunction, java.io.Serializable

public class median
extends DefaultArithFunction

Function: math.median(L): returns the median of values in L.

Examples:

  • math.median([1,3]): returns 2.
  • math.median([1,1,3]): returns 1.
  • math.median([1,1,3,a]): fail.
  • math.median([]): fail.
Author:
Jomi
See Also:
Min, Max, Sum, Average, Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    median()  
  • Method Summary

    Modifier and Type Method Description
    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

    Methods inherited from class jason.asSemantics.DefaultArithFunction

    allowUngroundTerms, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait