24 package org.lightjason.agentspeak.beliefbase;
26 import org.apache.commons.lang3.RandomStringUtils;
27 import org.junit.Test;
35 import java.util.stream.IntStream;
37 import static org.junit.Assert.assertEquals;
52 final int l_max = 1000;
56 IntStream.range( 0, l_max )
58 .map( i ->
CLiteral.
from( RandomStringUtils.random( 12,
"~abcdefghijklmnopqrstuvwxyz/".toCharArray() ) ) )
59 .forEach( i -> l_beliefbase.
generate( l_generator, i.functorpath() ).add( i ) );
61 assertEquals(
"number of beliefs is incorrect", l_beliefbase.
size(), l_max );
80 .generate( l_gen,
CPath.
from(
"second/sub" ) )
87 assertEquals(
"number of beliefs is incorrect", l_beliefbase.
size(), 6 );
base test class with helpers
static IPath from( @Nonnull final String p_string)
factor method to build path
class to create a path structure
view for a beliefbase that creates any access to the underlying data structures
final IView apply(final String p_name, final IView p_parent)
thread-safe storage of the data of single- and multi-elements
final void testTree()
random test tree structure
default generic literal class for agent beliefs a literal consists of a functor, an optional list of ...
IView generate( @Nonnull final IViewGenerator p_generator, @Nonnull final IPath... p_paths)
generates path structure
interface for generating non-existing beliefbases views
final void testManual()
manual test of tree structure
static ILiteral from( @Nonnull final String p_functor, @Nullable final ITerm... p_values)
factory
final IView create( @Nonnull final String p_name)
returns a new view of the belief base
int size()
returns the size of literals
IView add( @Nonnull final ILiteral... p_literal)
adds a literal in the current structure
beliefbase to generate any event-based data by reference counting