24 package org.lightjason.agentspeak.language.execution.action.achievement_test;
26 import org.apache.commons.lang3.tuple.ImmutableTriple;
38 import javax.annotation.Nonnull;
39 import java.util.Collection;
40 import java.util.Collections;
41 import java.util.Objects;
74 @SuppressWarnings(
"unchecked" )
79 final Collection<IRule> l_rules = p_context.agent().rules().get( p_value.fqnfunctor() );
80 if ( Objects.isNull( l_rules ) )
89 ? l_rules.parallelStream()
95 final Set<IVariable<?>> l_variables = p_context.agent().unifier().unify( l_unified, i.identifier() );
99 false, i.instantiate( p_context.agent(), l_variables.stream() ),
100 Collections.<
ITerm>emptyList(),
101 Collections.<
ITerm>emptyList()
105 return new ImmutableTriple<>( p_context.agent().fuzzy().getValue().defuzzify( l_return ), l_return, l_variables );
110 .filter( ImmutableTriple::getLeft )
117 i.getRight().parallelStream()
119 .forEach( j -> ( (IRelocateVariable) j ).relocate() );
121 return i.getMiddle();
136 public final boolean equals(
final Object p_object )
138 return ( p_object instanceof
IExecution ) && ( this.
hashCode() == p_object.hashCode() );
ILiteral allocate( @Nonnull final IContext p_context)
allocate all variables with the current context
internal execution interface
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
interface of logical rule
interface for relocated variables (linkage between two variables for transfering the value) ...
abstract class for execute a logical-rule
execution context with local data
final boolean equals(final Object p_object)
result for an immutable fuzzy value
static IFuzzyValue< Boolean > execute(final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final ILiteral p_value)
execute rule from context
static final long serialVersionUID
serial id
IAchievementRule( @Nonnull final T p_type)
ctor