LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.consistency.CConsistency Class Reference

layer with consistency data based a markov-chain More...

+ Inheritance diagram for org.lightjason.agentspeak.consistency.CConsistency:
+ Collaboration diagram for org.lightjason.agentspeak.consistency.CConsistency:

Classes

enum  EAlgorithm
 numeric algorithm structure More...
 

Public Member Functions

final IConsistency add ( @Nonnull final IAgent<?> p_object)
 adds a new object More...
 
final IConsistency call () throws Exception
 
final IConsistency clear ()
 clear More...
 
final Stream< Map.Entry< IAgent<?>, Double > > consistency ()
 stream over all data More...
 
final double consistency ( @Nonnull final IAgent<?> p_object)
 returns the consistency of an object More...
 
final IFilter filter ()
 returns the used metric filter More...
 
final double inconsistency ( @Nonnull final IAgent<?> p_object)
 returns the inconsistency of an object More...
 
final Stream< Map.Entry< IAgent<?>, Double > > inconsistency ()
 stream over all data More...
 
final IMetric metric ()
 returns the used metric More...
 
final IConsistency remove ( @Nonnull final IAgent<?> p_object)
 removes an object More...
 
final DescriptiveStatistics statistic ()
 returns statistic data of the consistency values More...
 
final String toString ()
 

Static Public Member Functions

static IConsistency heuristic (final IFilter p_filter, final IMetric p_metric)
 factory heuristic algorithm More...
 
static IConsistency heuristic (final IFilter p_filter, final IMetric p_metric, final int p_iteration)
 factory heuristic algorithm More...
 
static IConsistency heuristic (final IFilter p_filter, final IMetric p_metric, final int p_iteration, final double p_epsilon)
 factory numerical algorithm More...
 
static IConsistency numeric (final IFilter p_filter, final IMetric p_metric)
 factory numerical algorithm More...
 

Private Member Functions

 CConsistency ( @Nonnull final EAlgorithm p_algorithm, @Nonnull final IFilter p_filter, @Nonnull final IMetric p_metric, final int p_iteration, final double p_epsilon)
 ctor More...
 
double getMetricValue (final IAgent<?> p_first, final IAgent<?> p_second)
 returns metric consistency More...
 

Private Attributes

final EAlgorithm m_algorithm
 algorithm to calculate stationary probability More...
 
final Map< IAgent<?>, Map.Entry< Double, Double > > m_data = new ConcurrentHashMap<>()
 map with object and consistency & inconsistency value More...
 
final double m_epsilon
 epsilon consistency to create an aperiodic markow-chain More...
 
final IFilter m_filter
 metric filter More...
 
final int m_iteration
 number of iterations of the stochastic algorithm More...
 
final IMetric m_metric
 metric object to create the consistency of two objects More...
 
final DescriptiveStatistics m_statistic = new SynchronizedDescriptiveStatistics()
 descriptive statistic More...
 

Static Private Attributes

static final DenseDoubleAlgebra ALGEBRA = DenseDoubleAlgebra.DEFAULT
 algebra More...
 
static final Map.Entry< Double, Double > DEFAULTNONEXISTING = new AbstractMap.SimpleImmutableEntry<>( 1.0, 0.0 )
 default value on non-existing objects More...
 
static final DoubleFunction PROBABILITYINVERT = p_value -> 1 - p_value
 function for inverting probability More...
 

Detailed Description

Definition at line 58 of file CConsistency.java.

Constructor & Destructor Documentation

◆ CConsistency()

org.lightjason.agentspeak.consistency.CConsistency.CConsistency ( @Nonnull final EAlgorithm  p_algorithm,
@Nonnull final IFilter  p_filter,
@Nonnull final IMetric  p_metric,
final int  p_iteration,
final double  p_epsilon 
)
private
Parameters
p_algorithmalgorithm
p_filtermetric filter
p_metricobject metric
p_iterationiterations
p_epsilonepsilon consistency

Definition at line 111 of file CConsistency.java.

Referenced by org.lightjason.agentspeak.consistency.CConsistency.heuristic(), and org.lightjason.agentspeak.consistency.CConsistency.numeric().

+ Here is the caller graph for this function:

Member Function Documentation

◆ add()

final IConsistency org.lightjason.agentspeak.consistency.CConsistency.add ( @Nonnull final IAgent<?>  p_object)
Parameters
p_objectnew object
Returns
self reference

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 130 of file CConsistency.java.

◆ call()

final IConsistency org.lightjason.agentspeak.consistency.CConsistency.call ( ) throws Exception

Definition at line 137 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.CConsistency.getMetricValue(), and org.lightjason.agentspeak.consistency.CConsistency.EAlgorithm.getStationaryDistribution().

+ Here is the call graph for this function:

◆ clear()

final IConsistency org.lightjason.agentspeak.consistency.CConsistency.clear ( )
Returns
self reference

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 204 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.IConsistency.clear().

+ Here is the call graph for this function:

◆ consistency() [1/2]

final Stream<Map.Entry<IAgent<?>, Double> > org.lightjason.agentspeak.consistency.CConsistency.consistency ( )
Returns
entry with agent and consistency

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 227 of file CConsistency.java.

◆ consistency() [2/2]

final double org.lightjason.agentspeak.consistency.CConsistency.consistency ( @Nonnull final IAgent<?>  p_object)
Parameters
p_objectobject
Returns
consistency or default consistency

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 234 of file CConsistency.java.

◆ filter()

final IFilter org.lightjason.agentspeak.consistency.CConsistency.filter ( )

◆ getMetricValue()

double org.lightjason.agentspeak.consistency.CConsistency.getMetricValue ( final IAgent<?>  p_first,
final IAgent<?>  p_second 
)
private
Parameters
p_firstfirst element
p_secondsecend element
Returns
metric consistency

Definition at line 266 of file CConsistency.java.

Referenced by org.lightjason.agentspeak.consistency.CConsistency.call().

+ Here is the caller graph for this function:

◆ heuristic() [1/3]

static IConsistency org.lightjason.agentspeak.consistency.CConsistency.heuristic ( final IFilter  p_filter,
final IMetric  p_metric 
)
static
Parameters
p_filtermetric filter
p_metricobject metric
Returns
consistency

Definition at line 296 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.CConsistency.CConsistency(), and org.lightjason.agentspeak.consistency.CConsistency.EAlgorithm.FIXPOINT.

+ Here is the call graph for this function:

◆ heuristic() [2/3]

static IConsistency org.lightjason.agentspeak.consistency.CConsistency.heuristic ( final IFilter  p_filter,
final IMetric  p_metric,
final int  p_iteration 
)
static
Parameters
p_filtermetric filter
p_metricobject metric
p_iterationnumber of iterations
Returns
consistency

Definition at line 309 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.CConsistency.CConsistency(), and org.lightjason.agentspeak.consistency.CConsistency.EAlgorithm.FIXPOINT.

+ Here is the call graph for this function:

◆ heuristic() [3/3]

static IConsistency org.lightjason.agentspeak.consistency.CConsistency.heuristic ( final IFilter  p_filter,
final IMetric  p_metric,
final int  p_iteration,
final double  p_epsilon 
)
static
Parameters
p_filtermetric filter
p_metricobject metric
p_iterationnumber of iterations
p_epsilonepsilon
Returns
consistency

Definition at line 323 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.CConsistency.CConsistency(), and org.lightjason.agentspeak.consistency.CConsistency.EAlgorithm.FIXPOINT.

+ Here is the call graph for this function:

◆ inconsistency() [1/2]

final double org.lightjason.agentspeak.consistency.CConsistency.inconsistency ( @Nonnull final IAgent<?>  p_object)
Parameters
p_objectobject
Returns
consistency or default consistency

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 241 of file CConsistency.java.

◆ inconsistency() [2/2]

final Stream<Map.Entry<IAgent<?>, Double> > org.lightjason.agentspeak.consistency.CConsistency.inconsistency ( )
Returns
entry with agent and inconsistency

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 248 of file CConsistency.java.

◆ metric()

final IMetric org.lightjason.agentspeak.consistency.CConsistency.metric ( )

◆ numeric()

static IConsistency org.lightjason.agentspeak.consistency.CConsistency.numeric ( final IFilter  p_filter,
final IMetric  p_metric 
)
static
Parameters
p_filtermetric filter
p_metricobject metric
Returns
consistency

Definition at line 284 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.CConsistency.CConsistency(), and org.lightjason.agentspeak.consistency.CConsistency.EAlgorithm.NUMERICAL.

+ Here is the call graph for this function:

◆ remove()

final IConsistency org.lightjason.agentspeak.consistency.CConsistency.remove ( @Nonnull final IAgent<?>  p_object)
Parameters
p_objectremoving object
Returns
self reference

Implements org.lightjason.agentspeak.consistency.IConsistency.

Definition at line 196 of file CConsistency.java.

References org.lightjason.agentspeak.consistency.IConsistency.remove().

+ Here is the call graph for this function:

◆ statistic()

final DescriptiveStatistics org.lightjason.agentspeak.consistency.CConsistency.statistic ( )

◆ toString()

final String org.lightjason.agentspeak.consistency.CConsistency.toString ( )

Member Data Documentation

◆ ALGEBRA

final DenseDoubleAlgebra org.lightjason.agentspeak.consistency.CConsistency.ALGEBRA = DenseDoubleAlgebra.DEFAULT
staticprivate

Definition at line 67 of file CConsistency.java.

◆ DEFAULTNONEXISTING

final Map.Entry<Double, Double> org.lightjason.agentspeak.consistency.CConsistency.DEFAULTNONEXISTING = new AbstractMap.SimpleImmutableEntry<>( 1.0, 0.0 )
staticprivate

Definition at line 63 of file CConsistency.java.

◆ m_algorithm

final EAlgorithm org.lightjason.agentspeak.consistency.CConsistency.m_algorithm
private

Definition at line 75 of file CConsistency.java.

◆ m_data

final Map<IAgent<?>, Map.Entry<Double, Double> > org.lightjason.agentspeak.consistency.CConsistency.m_data = new ConcurrentHashMap<>()
private

◆ m_epsilon

final double org.lightjason.agentspeak.consistency.CConsistency.m_epsilon
private

Definition at line 95 of file CConsistency.java.

◆ m_filter

final IFilter org.lightjason.agentspeak.consistency.CConsistency.m_filter
private

◆ m_iteration

final int org.lightjason.agentspeak.consistency.CConsistency.m_iteration
private

Definition at line 99 of file CConsistency.java.

◆ m_metric

final IMetric org.lightjason.agentspeak.consistency.CConsistency.m_metric
private

◆ m_statistic

final DescriptiveStatistics org.lightjason.agentspeak.consistency.CConsistency.m_statistic = new SynchronizedDescriptiveStatistics()
private

◆ PROBABILITYINVERT

final DoubleFunction org.lightjason.agentspeak.consistency.CConsistency.PROBABILITYINVERT = p_value -> 1 - p_value
staticprivate

Definition at line 71 of file CConsistency.java.