예제 #1
0
                                    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));
         }
     }
 }
예제 #2
0
 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;
 }
예제 #3
0
        /**
         * loop metodi menee eri threadiin
         */
        void loop()
        {
            while (running)
            {
                Glut.glutMainLoopEvent();
                Glut.glutPostRedisplay();         // kamat ruudulle

                Thread.Sleep(1);
            }
        }
예제 #4
0
 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;
 }