24 package org.lightjason.agentspeak.action.builtin.graph;
26 import edu.uci.ics.jung.graph.DirectedSparseGraph;
27 import edu.uci.ics.jung.graph.DirectedSparseMultigraph;
28 import edu.uci.ics.jung.graph.Graph;
29 import edu.uci.ics.jung.graph.SparseGraph;
30 import edu.uci.ics.jung.graph.SparseMultigraph;
31 import edu.uci.ics.jung.graph.UndirectedSparseGraph;
32 import edu.uci.ics.jung.graph.UndirectedSparseMultigraph;
42 import javax.annotation.Nonnegative;
43 import javax.annotation.Nonnull;
44 import java.util.Arrays;
45 import java.util.Collections;
46 import java.util.List;
47 import java.util.Locale;
49 import java.util.stream.Collectors;
81 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return
85 .map(
ITerm::<String>raw )
89 .forEach( p_return::add );
110 private static final Set<String> TYPES = Collections.unmodifiableSet(
112 .map( i -> i.name().toUpperCase( Locale.ROOT ) )
113 .collect( Collectors.toSet() )
122 public final Graph<?, ?>
get()
127 return new SparseGraph<>();
130 return new SparseMultigraph<>();
133 return new DirectedSparseGraph<>();
135 case DIRECTEDSPARSEMULTI:
136 return new DirectedSparseMultigraph<>();
138 case UNDIRECTEDSPARSE:
139 return new UndirectedSparseGraph<>();
141 case UNDIRECTEDSPARSEMULTI:
142 return new UndirectedSparseMultigraph<>();
155 public static boolean exist( @Nonnull
final String p_value )
157 return TYPES.contains( p_value.toUpperCase( Locale.ROOT ) );
169 return EGraphTypes.valueOf( p_value.toUpperCase( Locale.ROOT ) );
base class of build-in actions for setting name by package/classname (without prefix character) ...
final int minimalArgumentNumber()
minimum number of arguments
static boolean exist( @Nonnull final String p_value)
checks if a key exists
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
static EGraphTypes from( @Nonnull final String p_value)
returns graph type
static< T > String languagestring(final T p_source, final String p_label, final Object... p_parameter)
returns the language depend string on any object
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
final Graph<?, ?> get()
returns a new graph instance
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
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
class for any helper calls
creates a graph data structure.
term structure for simple datatypes