Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- File List

Parameters.cs
Go to the documentation of this file.
1 using Microscopic_Traffic_Simulator___Model.GeneralParameters;
2 using System;
3 using System.IO;
4 using System.Runtime.Serialization.Formatters.Binary;
5
6 namespace Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.GeneralParameters
7 {
11 [Serializable]
12 public class Parameters
13 {
17 private CellularTopologyParameters cellularTopologyParameters = new CellularTopologyParameters();
21 public CellularTopologyParameters CellularTopologyParameters { get { return cellularTopologyParameters; } }
22
26 private TransitionFunctionParameters transitionFunctionParameters = new TransitionFunctionParameters();
30 public TransitionFunctionParameters TransitionFunctionParameters
31 {
32 get { return transitionFunctionParameters; }
33 }
34
39 public static Parameters Deserialize(string path)
40 {
41 using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read,
42 FileShare.Read))
43 {
44 return (Parameters)new BinaryFormatter().Deserialize(fs);
45 }
46 }
47
52 public void Serialize(string path)
53 {
54 using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write,
55 FileShare.None))
56 {
57 new BinaryFormatter().Serialize(fs, this);
58 }
59 }
60 }
61 }
Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.GeneralParameters.Parameters
Class containing all simulator parameters.
Definition: Parameters.cs:12
System
Microscopic_Traffic_Simulator___Model.GeneralParameters
Definition: TransitionFunctionParameters.cs:3
Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.GeneralParameters.Parameters.Serialize
void Serialize(string path)
Save parameters to file.
Definition: Parameters.cs:52
Microscopic_Traffic_Simulator___Model.GeneralParameters.TransitionFunctionParameters
Class containing parameters of transition function.
Definition: TransitionFunctionParameters.cs:9
Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.GeneralParameters.CellularTopologyParameters
Class containing parameters related to cellular topology.
Definition: CellularTopologyParameters.cs:9
Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.GeneralParameters.Parameters.Deserialize
static Parameters Deserialize(string path)
Opens parameters file to import.
Definition: Parameters.cs:39
Microscopic_Traffic_Simulator___Model