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(); }
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()); }
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; }
public MockAgent(AgentProgram agent) : base(agent) { }