Exemplo n.º 1
0
        /// <summary>
        /// This is called to load data from an ODCache
        /// </summary>
        /// <param name="o"></param>
        /// <param name="d"></param>
        /// <param name="cache"></param>
        internal void Set(int o, int d, OdCache cache)
        {
            LoadingO = o;
            if (Data[o] == null)
            {
                Data[o]    = new float[HighestZone][];
                HasData[o] = new bool[HighestZone];
                for (int k = HighestZone - 1; k >= 0; k--)
                {
                    Data[o][k] = new float[AmmountOfData];
                }
                for (int k = 0; k < HighestZone; k++)
                {
                    HasData[o][k] = false;
                }
            }
            HasData[o][d] = true;
            if (Data[o][d] == null)
            {
                Data[o][d] = new float[AmmountOfData];
            }
            int entry = 0;

            for (int time = 0; time < Times; time++)
            {
                for (int type = 0; type < Types; type++)
                {
                    Data[o][d][entry] = cache[o, d, time, type];
                    entry++;
                }
            }
        }
Exemplo n.º 2
0
        public void LoadFile(string odcFile)
        {
            OdCache cache = new OdCache(odcFile);

            FilesLoaded   = new CacheGenerationInfo(cache.Times, cache.Types, cache.HighestZone, 5);
            Times         = cache.Times;
            Types         = cache.Types;
            AmmountOfData = Types * Times;
            HighestZone   = cache.HighestZone;
            Data          = new float[HighestZone][][];
            HasData       = new bool[HighestZone][];
            cache.DumpToCreator(this);
            cache.Release();
        }