24 package org.lightjason.agentspeak.action.builtin.math.statistic;
26 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
35 import javax.annotation.Nonnull;
36 import java.util.List;
37 import java.util.stream.Collectors;
71 @Nonnull
final List<ITerm> p_return
74 final List<ITerm> l_arguments =
CCommon.
flatten( p_argument ).collect( Collectors.toList() );
75 if ( l_arguments.size() < 2 )
78 final double l_value = l_arguments.get( 0 ).<Number>raw().doubleValue();
81 .mapToDouble( i -> i.<DescriptiveStatistics>raw().getPercentile( l_value ) )
83 .forEach( p_return::add );
base class of build-in actions for setting name by package/classname (without prefix character) ...
returns for any static object a percentile value.
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
execution context with local data
static final long serialVersionUID
serial id
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
result for an immutable fuzzy value
final IFuzzyValue< Boolean > execute(final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument, @Nonnull final List< ITerm > p_return)
defines a plan-body operation
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
final int minimalArgumentNumber()
minimum number of arguments
term structure for simple datatypes