24 package org.lightjason.agentspeak.action.builtin.graph;
26 import com.google.common.base.Function;
27 import edu.uci.ics.jung.algorithms.shortestpath.PrimMinimumSpanningTree;
28 import edu.uci.ics.jung.graph.DelegateTree;
29 import edu.uci.ics.jung.graph.Graph;
38 import javax.annotation.Nonnegative;
39 import javax.annotation.Nonnull;
40 import java.util.Collections;
41 import java.util.List;
75 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
80 .map(
ITerm::<Number>raw )
81 .map( Number::doubleValue )
87 .map(
ITerm::<Map<?, Number>>raw )
88 .orElseGet( Collections::emptyMap );
90 final Function<Object, Double> l_weightfunction = e -> l_costmap.getOrDefault( e, l_defaultcost ).doubleValue();
91 final PrimMinimumSpanningTree<Object, Object> l_treefactory =
new PrimMinimumSpanningTree<>( DelegateTree.getFactory(), l_weightfunction );
96 .map(
ITerm::<Graph<Object, Object>>raw )
99 .forEach( p_return::add );
base class of build-in actions for setting name by package/classname (without prefix character) ...
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
final int minimalArgumentNumber()
minimum number of arguments
execution context with local data
creates a minimal spanning tree of any graph instance.
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
static< T > boolean rawvalueAssignableTo( @Nonnull final T p_value, @Nonnull final Class<?>... p_class)
checks a term value for assignable class
result for an immutable fuzzy value
static final long serialVersionUID
serial id
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
term structure for simple datatypes