24 package org.lightjason.agentspeak.action.builtin.math.linearprogram;
26 import org.apache.commons.lang3.tuple.ImmutablePair;
27 import org.apache.commons.math3.optim.linear.LinearConstraint;
28 import org.apache.commons.math3.optim.linear.LinearObjectiveFunction;
37 import javax.annotation.Nonnegative;
38 import javax.annotation.Nonnull;
39 import java.util.HashSet;
40 import java.util.List;
41 import java.util.stream.Collectors;
81 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
83 final List<Double> l_arguments =
CCommon.flatten( p_argument )
84 .map( i -> i.<Number>raw().doubleValue() )
85 .collect( Collectors.toList() );
89 new LinearObjectiveFunction(
90 l_arguments.stream().limit( l_arguments.size() - 1 ).mapToDouble( i -> i ).toArray(),
91 l_arguments.get( l_arguments.size() - 1 )
93 new HashSet<LinearConstraint>()
base class of build-in actions for setting name by package/classname (without prefix character) ...
final int minimalArgumentNumber()
minimum number of arguments
action to create a linear program.
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
execution context with local data
result for an immutable fuzzy value
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
static final long serialVersionUID
serial id
class for any helper calls
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
term structure for simple datatypes