Exemple #1
0
        protected override void OnRenderFrame(FrameEventArgs args)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit);

            _agentProgram.Use();
            _agentProgram.Iteration.Set(_iteration);
            _agentProgram.DeltaTime.Set((float)args.Time);
            _agentProgram.AgentSettings = AgentSettings;
            AgentProgram.Dispatch(_numberOfAgents / _localWorkGroupSize, 1, 1);

            Thread.Sleep(10);

            _fadeProgram.Use();
            _fadeProgram.DeltaTime.Set((float)args.Time);
            _fadeProgram.FadeSettings = FadeSettings;
            FadeProgram.Dispatch(_width / 10, _height / 10, 1);

            _renderProgram.Use();
            _renderProgram.Draw();

            _iteration += 1;
            _iteration %= int.MaxValue;

            SwapBuffers();
        }
Exemple #2
0
        protected override void OnLoad()
        {
            GL.ClearColor(Color4.CornflowerBlue);

            FadeSettings = FadeSettings.Default();

            _renderProgram = RenderProgram.Create();

            _textureOut = new Texture2D(SizedInternalFormat.Rgba8, _width, _height);
            _textureOut.SetFilter(TextureMinFilter.Nearest, TextureMagFilter.Nearest);
            _textureOut.Bind(TextureUnit.Texture0);

            _agentProgram = AgentProgram.Create(_width, _height, _textureOut, _numberOfAgents, AgentSettings.Default());

            _fadeProgram = FadeProgram.Create(_width, _height, _textureOut, FadeSettings.Default());
        }
Exemple #3
0
 public AbstractAgent(AgentProgram aProgram)
 {
     program = aProgram;
 }
 /**
  * Constructs an Agent with the specified AgentProgram.
  *
  * @param aProgram
  *            the Agent's program, which maps any given percept sequences to
  *            an action.
  */
 public AbstractAgent(AgentProgram aProgram)
 {
     program = aProgram;
 }
Exemple #5
0
 public MockAgent(AgentProgram agent) : base(agent)
 {
 }
Exemple #6
0
 public MockAgent(AgentProgram agent) : base(agent)
 {
 }