LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.language.CCommon Class Reference

common structure for execution definition More...

+ Collaboration diagram for org.lightjason.agentspeak.language.CCommon:

Classes

enum  ECompression
 compression algorithm More...
 

Static Public Member Functions

static< T > T deepclone ( @Nullable final T p_object)
 creates a deep-clone of an object More...
 
static Stream< ITermflatten ( @Nonnull final Collection<? extends ITerm > p_terms)
 flat term-in-term collection into a straight term list More...
 
static Stream< ITermflatten ( @Nonnull final Stream<? extends ITerm > p_terms)
 flat term-in-term stream into a straight term list More...
 
static Stream< ITermflattenrecursive ( @Nonnull final Stream< ITerm > p_input)
 recursive stream of term values More...
 
static Hasher getTermHashing ()
 returns the hasing function for term data More...
 
static IContext instantiate ( @Nonnull final IInstantiable p_instance, @Nonnull final IAgent<?> p_agent, @Nonnull final Stream< IVariable<?>> p_variable)
 creates the instantiate execution context with default variables More...
 
static Pair< IPlanStatistic, IContextinstantiateplan ( @Nonnull final IPlanStatistic p_planstatistic, @Nonnull final IAgent<?> p_agent, @Nonnull final Set< IVariable<?>> p_variables)
 instantiate a plan with context and plan-specific variables More...
 
static double levenshtein ( @Nonnull final String p_first, @Nonnull final String p_second, final double p_insertweight, final double p_replaceweight, final double p_deleteweight)
 calculates the levenshtein distance More...
 
static double min (final double p_first, final double p_second, final double p_third)
 returns the minimum of three elemens More...
 
static double ncd ( @Nonnull final ECompression p_compression, @Nonnull final String p_first, @Nonnull final String p_second)
 normalized-compression-distance More...
 
static< T > boolean rawvalueAssignableTo ( @Nonnull final T p_value, @Nonnull final Class<?>... p_class)
 checks a term value for assignable class More...
 
static List< ITermreplaceFromContext ( @Nonnull final IContext p_context, @Nonnull final Collection<? extends ITerm > p_terms)
 replace variables with context variables More...
 
static ITerm replaceFromContext ( @Nonnull final IContext p_context, @Nonnull final ITerm p_term)
 replace variable with context variable other values will be passed without context access More...
 
static< T > Stream< T > streamconcat ( @Nonnull final Stream< T >... p_streams)
 concat multiple streams More...
 
static Pair< Boolean, Set< IVariable<?> > > unifytrigger ( @Nonnull final IUnifier p_unifier, @Nonnull final ITrigger p_source, @Nonnull final ITrigger p_target)
 unifies trigger and creates the set of variables More...
 
static IContext updatecontext ( @Nonnull final IContext p_context, @Nonnull final Stream< IVariable<?>> p_unifiedvariables)
 updates within an instance context all variables of the stream More...
 
static Map< IVariable<?>, Integer > variablefrequency ( @Nonnull final ILiteral p_literal)
 consts the variables within a literal More...
 

Private Member Functions

 CCommon ()
 private ctor - avoid instantiation More...
 

Static Private Member Functions

static double compress ( @Nonnull final ECompression p_compression, @Nonnull final String p_input)
 compression algorithm More...
 
static Stream< ITermflattenstream ( @Nonnull final Stream<?> p_stream)
 

Static Private Attributes

static final Cloner CLONER = new Cloner()
 cloner More...
 

Detailed Description

Definition at line 73 of file language/CCommon.java.

Constructor & Destructor Documentation

◆ CCommon()

org.lightjason.agentspeak.language.CCommon.CCommon ( )
private

Definition at line 83 of file language/CCommon.java.

Member Function Documentation

◆ compress()

static double org.lightjason.agentspeak.language.CCommon.compress ( @Nonnull final ECompression  p_compression,
@Nonnull final String  p_input 
)
staticprivate
Parameters
p_compressioncompression algorithm
p_inputinput string
Returns
number of compression bytes
Warning
counting stream returns the correct number of bytes after flushing

Definition at line 427 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.language.CCommon.ncd().

+ Here is the caller graph for this function:

◆ deepclone()

static <T> T org.lightjason.agentspeak.language.CCommon.deepclone ( @Nullable final T  p_object)
static
Parameters
p_objectinput object
Template Parameters
Tobject type
Returns
deep-copy

Definition at line 340 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.CLONER.

Referenced by org.lightjason.agentspeak.language.CRawTerm< T >.deepcopy(), org.lightjason.agentspeak.language.variable.CVariable< T >.deepcopy(), and org.lightjason.agentspeak.language.variable.CVariable< T >.deepcopysuffix().

+ Here is the caller graph for this function:

◆ flatten() [1/2]

static Stream<ITerm> org.lightjason.agentspeak.language.CCommon.flatten ( @Nonnull final Collection<? extends ITerm p_terms)
static
Parameters
p_termsterm collection
Returns
flat term stream

Definition at line 271 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.flattenstream().

Referenced by org.lightjason.agentspeak.action.builtin.agent.CClearBeliefbase.execute(), org.lightjason.agentspeak.action.builtin.graph.IApplySingle.execute(), org.lightjason.agentspeak.action.builtin.graph.IApplyMultiple.execute(), org.lightjason.agentspeak.action.builtin.datetime.IDateTime.execute(), org.lightjason.agentspeak.action.builtin.bool.CCountTrue.execute(), org.lightjason.agentspeak.action.builtin.math.CSum.execute(), org.lightjason.agentspeak.action.builtin.string.CReverse.execute(), org.lightjason.agentspeak.action.builtin.math.CSin.execute(), org.lightjason.agentspeak.action.builtin.bool.CCountFalse.execute(), org.lightjason.agentspeak.action.builtin.string.CSize.execute(), org.lightjason.agentspeak.action.builtin.math.CSqrt.execute(), org.lightjason.agentspeak.action.builtin.math.CCos.execute(), org.lightjason.agentspeak.action.builtin.math.CAbs.execute(), org.lightjason.agentspeak.action.builtin.string.CUpper.execute(), org.lightjason.agentspeak.action.builtin.string.CLower.execute(), org.lightjason.agentspeak.action.builtin.string.CEndsWith.execute(), org.lightjason.agentspeak.action.builtin.math.CRadians.execute(), org.lightjason.agentspeak.action.builtin.math.CExp.execute(), org.lightjason.agentspeak.action.builtin.math.CFloor.execute(), org.lightjason.agentspeak.action.builtin.collection.tuple.CSet.execute(), org.lightjason.agentspeak.action.builtin.string.CContains.execute(), org.lightjason.agentspeak.action.builtin.math.CSignum.execute(), org.lightjason.agentspeak.action.builtin.math.CSinh.execute(), org.lightjason.agentspeak.action.builtin.math.CCosh.execute(), org.lightjason.agentspeak.action.builtin.math.CACos.execute(), org.lightjason.agentspeak.action.builtin.string.CStartsWith.execute(), org.lightjason.agentspeak.action.builtin.math.CASin.execute(), org.lightjason.agentspeak.action.builtin.math.CHypot.execute(), org.lightjason.agentspeak.action.builtin.math.CCeil.execute(), org.lightjason.agentspeak.action.builtin.math.CTanh.execute(), org.lightjason.agentspeak.action.builtin.math.CATan.execute(), org.lightjason.agentspeak.action.builtin.math.CLog10.execute(), org.lightjason.agentspeak.action.builtin.math.CDegrees.execute(), org.lightjason.agentspeak.action.builtin.agent.CAddPlan.execute(), org.lightjason.agentspeak.action.builtin.math.CPow.execute(), org.lightjason.agentspeak.action.builtin.bool.CAnd.execute(), org.lightjason.agentspeak.action.builtin.math.CFactorial.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CFlat.execute(), org.lightjason.agentspeak.action.builtin.math.CRound.execute(), org.lightjason.agentspeak.action.builtin.math.CGeometricMean.execute(), org.lightjason.agentspeak.action.builtin.math.CHarmonicMean.execute(), org.lightjason.agentspeak.action.builtin.math.CTan.execute(), org.lightjason.agentspeak.action.builtin.graph.CVertexCount.execute(), org.lightjason.agentspeak.action.builtin.bool.CXor.execute(), org.lightjason.agentspeak.action.builtin.math.CLog.execute(), org.lightjason.agentspeak.action.builtin.math.CMax.execute(), org.lightjason.agentspeak.action.builtin.math.CMin.execute(), org.lightjason.agentspeak.action.builtin.math.CAverage.execute(), org.lightjason.agentspeak.action.builtin.bool.CNot.execute(), org.lightjason.agentspeak.action.builtin.string.CConcat.execute(), org.lightjason.agentspeak.action.builtin.bool.COr.execute(), org.lightjason.agentspeak.action.builtin.graph.CEdgeCount.execute(), org.lightjason.agentspeak.action.builtin.string.CRandom.execute(), org.lightjason.agentspeak.action.builtin.string.CBase64Encode.execute(), org.lightjason.agentspeak.action.builtin.string.CReplace.execute(), org.lightjason.agentspeak.action.builtin.bool.CAnyMatch.execute(), org.lightjason.agentspeak.action.builtin.graph.CVertices.execute(), org.lightjason.agentspeak.action.builtin.math.CIsPrime.execute(), org.lightjason.agentspeak.action.builtin.math.CNextPrime.execute(), org.lightjason.agentspeak.action.builtin.bool.CAllMatch.execute(), org.lightjason.agentspeak.action.builtin.graph.CEdges.execute(), org.lightjason.agentspeak.action.builtin.math.CPrimeFactors.execute(), org.lightjason.agentspeak.action.builtin.string.CBase64Decode.execute(), org.lightjason.agentspeak.action.builtin.graph.CContainsEdge.execute(), org.lightjason.agentspeak.action.builtin.graph.CContainsVertex.execute(), org.lightjason.agentspeak.action.builtin.math.CBinomial.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CHammingDistance.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CHammingDistance.execute(), org.lightjason.agentspeak.action.builtin.math.CMaxIndex.execute(), org.lightjason.agentspeak.action.builtin.generic.type.IParse.execute(), org.lightjason.agentspeak.action.builtin.math.CMinIndex.execute(), org.lightjason.agentspeak.action.builtin.math.CSigmoid.execute(), org.lightjason.agentspeak.action.builtin.datetime.CBuild.execute(), org.lightjason.agentspeak.action.builtin.math.CStirling.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CToVector.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.IOperator.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.IOperator.execute(), org.lightjason.agentspeak.action.builtin.string.CNCD.execute(), org.lightjason.agentspeak.action.builtin.collection.IMapGetSingle< Map< Object, Object > >.execute(), org.lightjason.agentspeak.action.builtin.collection.map.CCreate.execute(), org.lightjason.agentspeak.action.builtin.collection.set.CCreate.execute(), org.lightjason.agentspeak.action.builtin.collection.IMapGetMultiple< Map< Object, Object > >.execute(), org.lightjason.agentspeak.action.builtin.collection.IMapApplySingle< Map< Object, Object > >.execute(), org.lightjason.agentspeak.action.builtin.graph.IApplyPathAlgorithm.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CRandomSimple.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CCreate.execute(), org.lightjason.agentspeak.action.builtin.generic.type.CIsString.execute(), org.lightjason.agentspeak.action.builtin.string.CLevenshtein.execute(), org.lightjason.agentspeak.action.builtin.agent.CPlanStatistic.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CSinglePercentile.execute(), org.lightjason.agentspeak.action.builtin.math.blas.CSize.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CSolve.execute(), org.lightjason.agentspeak.action.builtin.collection.IMapApplyMultiple< Map< Object, Object > >.execute(), org.lightjason.agentspeak.action.builtin.collection.multimap.CCreate.execute(), org.lightjason.agentspeak.action.builtin.generic.type.CIsNumeric.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.IRowColumn.execute(), org.lightjason.agentspeak.action.builtin.generic.type.ICast.execute(), org.lightjason.agentspeak.action.builtin.datetime.IPlusMinus.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CMultiplePercentile.execute(), org.lightjason.agentspeak.action.builtin.collection.set.CAdd.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CSum.execute(), org.lightjason.agentspeak.action.builtin.agent.CRemovePlan.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CFalseCount.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CFalseCount.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CRows.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CColumns.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CIdentity.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CSum.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CTrueCount.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CTrueCount.execute(), org.lightjason.agentspeak.action.builtin.generic.type.CIsNull.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CClearStatistic.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CNonZero.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CNonZero.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CNot.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CNot.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CDimension.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CDimension.execute(), org.lightjason.agentspeak.action.builtin.datetime.IBetween.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CTranspose.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CRank.execute(), org.lightjason.agentspeak.action.builtin.collection.set.CRemove.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CCreate.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CReverse.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CRows.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CRowSum.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CCopy.execute(), org.lightjason.agentspeak.action.builtin.generic.type.CFuzzyReturn.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CGet.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CSize.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CCopy.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CSize.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CCopy.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CInvert.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CTrace.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CDeterminant.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CCopy.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CDiagonal.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CColumns.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CColumnSum.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CMatrixNorm.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.COneNorm.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CCondition.execute(), org.lightjason.agentspeak.action.builtin.collection.set.CContains.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CSet.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CBoolValue.execute(), org.lightjason.agentspeak.action.builtin.collection.map.CRemove.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CTwoNorm.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CSet.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CCreate.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CGet.execute(), org.lightjason.agentspeak.action.builtin.collection.multimap.CValues.execute(), org.lightjason.agentspeak.action.builtin.collection.map.CValues.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CInfinityNorm.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CUnique.execute(), org.lightjason.agentspeak.action.builtin.collection.tuple.CCreate.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CClear.execute(), org.lightjason.agentspeak.action.builtin.generic.type.CIs.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CFlatConcat.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CSubMatrix.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CColumn.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CCreateStatistic.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CEigen.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CNumericValue.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CUnion.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CToList.execute(), org.lightjason.agentspeak.action.builtin.math.blas.CMultiply.execute(), org.lightjason.agentspeak.action.builtin.math.shape.CInTriangle.execute(), org.lightjason.agentspeak.action.builtin.collection.multimap.CAsMap.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CRow.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CToList.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CToList.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CSet.execute(), org.lightjason.agentspeak.action.builtin.graph.CSpanningTree.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CIntersect.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CGraphLaplacian.execute(), org.lightjason.agentspeak.action.builtin.math.shape.CInCircle.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CNormalizedGraphLaplacian.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CPower.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CCreate.execute(), org.lightjason.agentspeak.action.builtin.math.shape.CInRectangle.execute(), org.lightjason.agentspeak.action.builtin.math.interpolate.CSingleInterpolate.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CBoolValue.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CGet.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CSingularValue.execute(), org.lightjason.agentspeak.action.builtin.math.interpolate.CMultipleInterpolate.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CDotProduct.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CNumericValue.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CAssign.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CRange.execute(), org.lightjason.agentspeak.action.builtin.agent.CGetPlan.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CMultipleStatisticValue.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CSubList.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CRemove.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CCreate.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CZip.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CAssign.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CParse.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CSingleStatisticValue.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CRandomSample.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CAddStatisticValue.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CRange.execute(), org.lightjason.agentspeak.action.builtin.math.blas.CElementWise.execute(), org.lightjason.agentspeak.action.builtin.collection.list.CSymmetricDifference.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CToBlas.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CToBlas.execute(), org.lightjason.agentspeak.action.builtin.graph.CCreate.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CParse.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CPerronFrobenius.execute(), org.lightjason.agentspeak.action.builtin.math.interpolate.CCreate.execute(), org.lightjason.agentspeak.action.builtin.graph.CAdjacencyMatrix.execute(), org.lightjason.agentspeak.action.builtin.web.graphql.IBaseGraphQL.execute(), org.lightjason.agentspeak.action.builtin.storage.CExists.execute(), org.lightjason.agentspeak.action.builtin.storage.CRemove.execute(), and org.lightjason.agentspeak.action.builtin.math.statistic.CCreateDistribution.execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flatten() [2/2]

static Stream<ITerm> org.lightjason.agentspeak.language.CCommon.flatten ( @Nonnull final Stream<? extends ITerm p_terms)
static
Parameters
p_termsterm stream
Returns
flat term stream

Definition at line 284 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.flattenstream().

+ Here is the call graph for this function:

◆ flattenrecursive()

static Stream<ITerm> org.lightjason.agentspeak.language.CCommon.flattenrecursive ( @Nonnull final Stream< ITerm p_input)
static
Parameters
p_inputterm stream
Returns
term stream

Definition at line 296 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.flattenrecursive().

Referenced by org.lightjason.agentspeak.language.CCommon.flattenrecursive(), org.lightjason.agentspeak.language.unify.CUnifier.unify(), org.lightjason.agentspeak.language.CCommon.variablefrequency(), org.lightjason.agentspeak.language.execution.action.achievement_test.CAchievementRuleLiteral.variables(), org.lightjason.agentspeak.language.instantiable.rule.CRule.variables(), org.lightjason.agentspeak.language.execution.action.unify.CDefaultUnify.variables(), and org.lightjason.agentspeak.language.instantiable.plan.CPlan.variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flattenstream()

static Stream<ITerm> org.lightjason.agentspeak.language.CCommon.flattenstream ( @Nonnull final Stream<?>  p_stream)
staticprivate

Definition at line 309 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.flattenstream(), org.lightjason.agentspeak.language.CRawTerm< T >.from(), and org.lightjason.agentspeak.language.ITerm.raw().

Referenced by org.lightjason.agentspeak.language.CCommon.flatten(), and org.lightjason.agentspeak.language.CCommon.flattenstream().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTermHashing()

static Hasher org.lightjason.agentspeak.language.CCommon.getTermHashing ( )
static
Returns
hasher

Definition at line 326 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.common.CPath.hashCode().

+ Here is the caller graph for this function:

◆ instantiate()

static IContext org.lightjason.agentspeak.language.CCommon.instantiate ( @Nonnull final IInstantiable  p_instance,
@Nonnull final IAgent<?>  p_agent,
@Nonnull final Stream< IVariable<?>>  p_variable 
)
static
Parameters
p_instanceinstance object
p_agentagent
p_variablevariable stream
Returns
context object

Definition at line 112 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.instantiate(), and org.lightjason.agentspeak.language.instantiable.IBaseInstantiable.instantiate().

+ Here is the caller graph for this function:

◆ instantiateplan()

static Pair<IPlanStatistic, IContext> org.lightjason.agentspeak.language.CCommon.instantiateplan ( @Nonnull final IPlanStatistic  p_planstatistic,
@Nonnull final IAgent<?>  p_agent,
@Nonnull final Set< IVariable<?>>  p_variables 
)
static
Parameters
p_planstatisticplan statistic for instatiation
p_agentagent
p_variablesinstantiated variables
Returns
pair of planstatistic and context

Definition at line 161 of file language/CCommon.java.

◆ levenshtein()

static double org.lightjason.agentspeak.language.CCommon.levenshtein ( @Nonnull final String  p_first,
@Nonnull final String  p_second,
final double  p_insertweight,
final double  p_replaceweight,
final double  p_deleteweight 
)
static
Parameters
p_firstfirst string
p_secondsecond string
p_insertweightinserting weight
p_replaceweightreplace weight
p_deleteweightdelete weight
Returns
distance
See also
https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Java

Definition at line 358 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.min().

Referenced by org.lightjason.agentspeak.consistency.metric.CLevenshteinDistance.apply(), and org.lightjason.agentspeak.action.builtin.string.CLevenshtein.execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ min()

static double org.lightjason.agentspeak.language.CCommon.min ( final double  p_first,
final double  p_second,
final double  p_third 
)
static
Parameters
p_firstfirst value
p_secondsecond value
p_thirdthird value
Returns
minimum

Definition at line 394 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.language.CCommon.levenshtein().

+ Here is the caller graph for this function:

◆ ncd()

static double org.lightjason.agentspeak.language.CCommon.ncd ( @Nonnull final ECompression  p_compression,
@Nonnull final String  p_first,
@Nonnull final String  p_second 
)
static
Parameters
p_compressioncompression algorithm
p_firstfirst string
p_secondsecond string
Returns
distance in [0,1]

Definition at line 408 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.compress().

Referenced by org.lightjason.agentspeak.consistency.metric.CNCD.apply(), and org.lightjason.agentspeak.action.builtin.string.CNCD.execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rawvalueAssignableTo()

static <T> boolean org.lightjason.agentspeak.language.CCommon.rawvalueAssignableTo ( @Nonnull final T  p_value,
@Nonnull final Class<?>...  p_class 
)
static
Parameters
p_valueany value type
p_classassignable class
Returns
term value or raw value

Definition at line 215 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.action.builtin.math.blas.CElementWise.apply(), org.lightjason.agentspeak.action.builtin.collection.CClear.clear(), org.lightjason.agentspeak.language.execution.expression.numerical.CRelational.compare(), org.lightjason.agentspeak.action.builtin.collection.CIsEmpty.empty(), org.lightjason.agentspeak.action.builtin.string.CLevenshtein.execute(), org.lightjason.agentspeak.action.builtin.graph.IApplyPathAlgorithm.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CIdentity.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CClearStatistic.execute(), org.lightjason.agentspeak.action.builtin.bool.CEqual.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CColumnSum.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CDiagonal.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CRowSum.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CClear.execute(), org.lightjason.agentspeak.action.builtin.math.blas.CMultiply.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CSet.execute(), org.lightjason.agentspeak.action.builtin.graph.CSpanningTree.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CCreate.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CAssign.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CFromList.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CCreate.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CMultipleStatisticValue.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CAssign.execute(), org.lightjason.agentspeak.action.builtin.math.blas.vector.CParse.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CAddStatisticValue.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CSingleStatisticValue.execute(), org.lightjason.agentspeak.action.builtin.math.bit.vector.CToBlas.execute(), org.lightjason.agentspeak.action.builtin.math.bit.matrix.CToBlas.execute(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CParse.execute(), org.lightjason.agentspeak.action.builtin.graph.CAdjacencyMatrix.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.CCreateDistribution.execute(), org.lightjason.agentspeak.action.builtin.datetime.IDateTime.getdatetime(), org.lightjason.agentspeak.action.builtin.agent.CGetPlan.query(), org.lightjason.agentspeak.action.builtin.agent.CRemovePlan.remove(), org.lightjason.agentspeak.action.builtin.math.blas.matrix.CSolve.result(), and org.lightjason.agentspeak.action.builtin.collection.CSize.size().

+ Here is the caller graph for this function:

◆ replaceFromContext() [1/2]

static List<ITerm> org.lightjason.agentspeak.language.CCommon.replaceFromContext ( @Nonnull final IContext  p_context,
@Nonnull final Collection<? extends ITerm p_terms 
)
static
Parameters
p_contextexecution context
p_termsreplacing term list
Returns
result term list

Definition at line 234 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.replaceFromContext().

Referenced by org.lightjason.agentspeak.language.execution.expressionunary.CDecrement< T extends Number >.execute(), org.lightjason.agentspeak.language.execution.expressionunary.CIncrement< T extends Number >.execute(), org.lightjason.agentspeak.action.builtin.math.statistic.ISelection.execute(), org.lightjason.agentspeak.language.execution.action.unify.CVariableUnify.execute(), and org.lightjason.agentspeak.language.CCommon.replaceFromContext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceFromContext() [2/2]

static ITerm org.lightjason.agentspeak.language.CCommon.replaceFromContext ( @Nonnull final IContext  p_context,
@Nonnull final ITerm  p_term 
)
static
Parameters
p_contextexecution context
p_termterm
Returns
replaces variable object

Definition at line 248 of file language/CCommon.java.

References org.lightjason.agentspeak.common.CCommon.languagestring().

+ Here is the call graph for this function:

◆ streamconcat()

static <T> Stream<T> org.lightjason.agentspeak.language.CCommon.streamconcat ( @Nonnull final Stream< T >...  p_streams)
static
Parameters
p_streamsstreams
Template Parameters
Tany value type
Returns
concated stream

Definition at line 185 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.language.instantiable.plan.CPlan.CPlan(), org.lightjason.agentspeak.language.instantiable.rule.CRule.variables(), and org.lightjason.agentspeak.language.instantiable.plan.CPlan.variables().

+ Here is the caller graph for this function:

◆ unifytrigger()

static Pair<Boolean, Set<IVariable<?> > > org.lightjason.agentspeak.language.CCommon.unifytrigger ( @Nonnull final IUnifier  p_unifier,
@Nonnull final ITrigger  p_source,
@Nonnull final ITrigger  p_target 
)
static
Note
target trigger literal must be cloned to avoid variable overwriting
Parameters
p_unifierunifier
p_sourceinput trigger (with values)
p_targettrigger (of a plan / rule)
Returns
pair of valid unification and unified variables

Definition at line 136 of file language/CCommon.java.

◆ updatecontext()

static IContext org.lightjason.agentspeak.language.CCommon.updatecontext ( @Nonnull final IContext  p_context,
@Nonnull final Stream< IVariable<?>>  p_unifiedvariables 
)
static
Parameters
p_contextcontext
p_unifiedvariablesunified variables as stream
Returns
context reference

Definition at line 97 of file language/CCommon.java.

Referenced by org.lightjason.agentspeak.language.unify.CUnifier.evaluateexpression(), org.lightjason.agentspeak.language.execution.action.unify.CVariableUnify.execute(), and org.lightjason.agentspeak.language.unify.CUnifier.unify().

+ Here is the caller graph for this function:

◆ variablefrequency()

static Map<IVariable<?>, Integer> org.lightjason.agentspeak.language.CCommon.variablefrequency ( @Nonnull final ILiteral  p_literal)
static
Parameters
p_literalliteral
Returns
map with frequency

Definition at line 197 of file language/CCommon.java.

References org.lightjason.agentspeak.language.CCommon.flattenrecursive().

Referenced by org.lightjason.agentspeak.language.execution.action.unify.CDefaultUnify.CDefaultUnify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ CLONER

final Cloner org.lightjason.agentspeak.language.CCommon.CLONER = new Cloner()
staticprivate