GenericGridWorldDynamicState> > Compute( GenericGridWorldStaticState StaticState, GenericGridWorldDynamicState DynamicState, Goal <GenericGridWorldStaticState, GenericGridWorldDynamicState> Goal, Operator <GenericGridWorldStaticState, GenericGridWorldDynamicState>[] Actions) { while (true) { while (Operators.Count == 0) { Thread.Sleep(100); if (this.sv != null) { sv.VisualizeAlg(StaticState, StaticState.InitialDynamicState, new OpenGLStateVisualizer.OpenGlVisulizationData( )); Glut.glutPostRedisplay( ); Glut.glutMainLoopEvent( ); Gl.glFinish( ); } } var op = Operators.Dequeue( ); System.Console.WriteLine("Got Op --> {0}", op); if (op.IsValidOn(StaticState.InitialDynamicState, StaticState, false)) { System.Console.WriteLine("Trying Op --> {0}", op); yield return(GridWorldOperator.MakePath(op)); } } }
public override void VisualizeAlg(GenericGridWorldStaticState StaticState, GenericGridWorldDynamicState DynamicState, object AlgData) { lock (this) { PriorityQueue <Metric, GenericGridWorldDynamicState> OL = null; if (this.vd != null) { OL = vd.OL; } this.vd = (OpenGLStateVisualizer.OpenGlVisulizationData)AlgData; if (this.vd != null && this.vd.OL == null) { vd.OL = OL; } } while (!nextAction && !nextPlanning) { if (continuous && fast_continuous) { break; } Glut.glutPostRedisplay( ); Glut.glutMainLoopEvent( ); if (continuous) { break; } } nextPlanning = false; }
/** * loop metodi menee eri threadiin */ void loop() { while (running) { Glut.glutMainLoopEvent(); Glut.glutPostRedisplay(); // kamat ruudulle Thread.Sleep(1); } }
public override void Visualize(GenericGridWorldStaticState StaticState, GenericGridWorldDynamicState DyanmicState) { lock (this) { this.DyanmicState = DyanmicState; this.StaticState = StaticState; } while (!nextAction && !nextPlanning) { Glut.glutPostRedisplay( ); Glut.glutMainLoopEvent( ); if (continuous) { break; } } nextAction = false; nextPlanning = false; }