24 package org.lightjason.agentspeak.consistency.metric;
28 import java.util.Collection;
29 import java.util.HashSet;
30 import java.util.stream.Collectors;
31 import java.util.stream.Stream;
43 public final Double
apply(
final Stream<? extends ITerm> p_first,
final Stream<? extends ITerm> p_second )
45 final Collection<ITerm> l_first = p_first.collect( Collectors.toCollection( HashSet<ITerm>::new ) );
46 final Collection<ITerm> l_second = p_second.collect( Collectors.toCollection( HashSet<ITerm>::new ) );
48 return ( l_first.containsAll( l_second ) ) && ( l_second.containsAll( l_first ) ) ? 0.0 : 1.0;
final Double apply(final Stream<? extends ITerm > p_first, final Stream<? extends ITerm > p_second)
metric interface of the coherency structure