Beispiel #1
0
        public Simulations(Dictionary <string, string> megagridAddressDictionary, Digest digest)
        {
            foreach (KeyValuePair <string, string> kvp in megagridAddressDictionary)
            {
                if (!simulations.ContainsKey(kvp.Value.Trim()))
                {
                    SimulationModel simModel = new SimulationModel();

                    CompiledCode code  = digest.FindByName(kvp.Value);
                    Grid         grid  = Pivot.ToGrid(new Code(code.minimalCode));
                    RectList     rects = Pivot.ToRects(grid);
                    simModel.grid = grid;
                    RasterLib.RasterApi.BuildCircuit(rects, true);
                    simModel.rects = rects;
                    simModel.Build();
                    simulations.Add(kvp.Value.Trim(), simModel);
                }
            }
        }
Beispiel #2
0
        static void Main()
        {
            string name         = "GateTimer";
            string glycFilename = "c:\\github\\glyphics2\\glyph cores\\" + name + ".glyc";
            string codeString   = RasterLib.RasterApi.ReadGlyc(glycFilename).Replace(';', '\n');

            Grid     grid  = Pivot.ToGrid(codeString);
            RectList rects = Pivot.ToRects(grid);
            //RasterLib.RasterApi.BuildCircuit(rects, true);

            //Console.WriteLine("Rects\n");
            //Console.WriteLine(rects);

            SimulationModel model = new SimulationModel();

            model.grid  = grid;
            model.rects = rects;
            model.Build();


            Console.ReadKey();
            Simulation.RunSimulation(model, name);
        }