public Simulation(State_Variables state)
        {
            Coordinate_Range = new double[state.Dimension];
            Speed_Range      = new double[state.Dimension];

            Out = new Output_Variables(state);
            // Fixing the pointer handles
            handle_Positions  = new GCHandle[state.Num_Points];
            handle_Velocities = new GCHandle[state.Num_Points];
            unsafe
            {
                // Un-managed Code!
                Q = new Quantization(state.Num_Points, state.Num_ScaleBins);
            }

            Tile = new Tile_Variables(Q.Num_TileHubs, Q.Tile_Dimension);
            unsafe
            {
                // Un-managed Code!
                for (uint i_p = 0; i_p < Tile.Num_TileHubs; i_p++)
                {
                    for (uint i_d = 0; i_d < Tile.Tile_Dimension; i_d++)
                    {
                        Tile.Tile_Positions[i_p][i_d] = Q.Tile_Positions[i_p][i_d];
                    }
                }
            }
        }
Beispiel #2
0
        public Output_Variables Output_XML(string file_name)
        {
            FileStream fileStream = new FileStream(file_name, FileMode.Open);

            Output_Variables output = (Output_Variables)Output_XmlSerializer.Deserialize(fileStream);

            return(output);
        }
Beispiel #3
0
        public void Write_XML(string file_name, Output_Variables output)
        {
            TextWriter textWriter = new StreamWriter(file_name);

            Output_XmlSerializer.Serialize(textWriter, output);

            textWriter.Close();
        }