LightVoting
 All Classes Namespaces Files Functions Variables Pages
CVariableBuilder.java
Go to the documentation of this file.
1 
24 package org.lightvoting.simulation.constants;
25 
26 import org.lightjason.agentspeak.agent.IAgent;
27 import org.lightjason.agentspeak.language.execution.IVariableBuilder;
28 import org.lightjason.agentspeak.language.instantiable.IInstantiable;
29 import org.lightjason.agentspeak.language.variable.CConstant;
30 import org.lightjason.agentspeak.language.variable.IVariable;
33 
34 import java.util.stream.Stream;
35 
36 
41 public final class CVariableBuilder implements IVariableBuilder
42 {
43 
48  private final CEnvironment m_environment;
49 
55  public CVariableBuilder( final CEnvironment p_environment )
56  {
57  m_environment = p_environment;
58  }
59 
60  @Override
61  public final Stream<IVariable<?>> generate( final IAgent<?> p_agent, final IInstantiable p_runningcontext )
62  {
63  return Stream.of(
64  new CConstant<>( "MyName", p_agent.<CVotingAgent>raw().name() )
65  );
66  }
67 }
final CEnvironment m_environment
environment reference
final Stream< IVariable<?> > generate(final IAgent<?> p_agent, final IInstantiable p_runningcontext)
BDI agent with voting capabilities.
CVariableBuilder(final CEnvironment p_environment)
constructor