Exemple #1
0
 /// <summary>
 /// Finishes the required parsing
 /// </summary>
 public override void FinishParse( )
 {
     // This must be done here otherwise opengl double start error...
       if ( vis == null ) {
     vis = new OpenGLStateVisualizer( );
       }
       if ( !Directory.Exists( this.file ) ) {
     SetFilename( this.file );
       }
 }
Exemple #2
0
        /// <summary>
        /// A constructor to setup all the applicable fields.
        /// </summary>
        /// <param name="IO"></param>
        /// <param name="WorldLoader"></param>
        /// <param name="Algorithm"></param>
        /// <param name="Weight"></param>
        public AlgorithmRunner( System.IO.TextReader IO,
            GridWorldLoader<GenericGridWorldStaticState,
            GenericGridWorldDynamicState> WorldLoader, String Algorithm,
            Metric Weight, bool Batch, StateVisualizer<GenericGridWorldStaticState,
            GenericGridWorldDynamicState> vis, int Seed)
        {
            gen = new Random( Seed );
              this.vis = vis;
              this.Goal = new DestinationsReachedGoal( );
              this.Algorithm = new GenericAlgorithmFactory<GenericGridWorldStaticState,
            GenericGridWorldDynamicState>( ).SetRealTimeData(
            new SingleUnitOctileDistanceHeuristic( ), vis,
            new SingleUnitTransformer( ), Weight, 0.1 ).GetAlgorithm(
            Algorithm, null, 0 );

              GenericGridWorldDynamicState InitialDynamicState;
              WorldLoader.Load( IO, out StaticState, out InitialDynamicState );
              IO.Close( );
              this.Actions = GridWorldOperator.Ops;
        }