Пример #1
0
 public void Start()
 {
     var matrix = new EmmeMatrix(Root.ZoneSystem.ZoneArray, MatrixToSave.AquireResource<SparseTwinIndex<float>>().GetFlatData());
     matrix.Save(OutputFile, true);
 }
Пример #2
0
        private static void CopySummedMatrix(IZone[] zones, string[] origins, string destination)
        {
            var array = new float[zones.Length * zones.Length];
            try
            {
                for(int i = 0; i < origins.Length; i++)
                {
                    BinaryHelpers.ExecuteReader((reader =>
                    {
                        var matrix = new EmmeMatrix(reader);
                        AddToArray(array, matrix.FloatData);
                    }), origins[i]);
                }
                SaveData.SaveMatrix(zones, array, destination);
            }
            catch (IOException)
            {

            }
        }
Пример #3
0
 internal void Execute(int iteration)
 {
     BinaryHelpers.ExecuteReader((reader) =>
     {
         EmmeMatrix matrix = new EmmeMatrix(reader);
         switch (matrix.Type)
         {
             case EmmeMatrix.DataType.Float:
                 ProcessData(matrix.FloatData, iteration);
                 break;
             default:
                 throw new XTMFRuntimeException("In '" + Name + "' the data type for the file '" + DemandMatrix + "' was not float!");
         }
     }, DemandMatrix);
 }
Пример #4
0
        private static void CopyMatrix(IZone[] zones, string origin, string destination)
        {
            try
            {
                BinaryHelpers.ExecuteReader((reader =>
                {
                    var matrix = new EmmeMatrix(reader);
                    SaveData.SaveMatrix(zones, matrix.FloatData, destination);
                }), origin);
            }
            catch (IOException)
            {

            }
        }