Ejemplo n.º 1
0
        /// <summary>
        /// Updates game
        /// </summary>
        /// <param name="gameTime"></param>
        protected override void Update(GameTime gameTime)
        {
            var ds = GetService<DebugStrings>();
            var debRen = GetService<DebugRender>();

            var graphSys = GetService<GraphSystem>();

            if(InputDevice.IsKeyDown(Keys.X)) {
                Graph graph = Graph.MakeTree( 4096, 40 );
            //		Graph<BaseNode> graph = Graph<BaseNode>.MakeRing( 512 );
                graphSys.AddGraph(graph);
            }

            if(InputDevice.IsKeyDown(Keys.Z)) {
            //				StanfordNetwork graph = new StanfordNetwork();
                stNet = new StanfordNetwork();

            //			stNet.ReadFromFile("../../../../p2p_networks/p2p-Gnutella25.txt");

                //stNet.ReadFromFile("../../../../medicine/edgeList.txt");
                stNet.ReadFromFile("../../../../medicine/edge.txt");
                //stNet.ReadFromFile("D:/Graphs/collab_networks/CA-GrQc.txt");
            //			stNet.ReadFromFile("../../../../collab_networks/CA-HepTh.txt");
            //			stNet.ReadFromFile("../../../../collab_networks/CA-CondMat.txt");

            //			stNet.ReadFromFile("../../../../cit_networks/Cit-HepTh.txt");

                graphSys.AddGraph(stNet);
                // graph file names:
                // CA-GrQc small
                // CA-HepTh middle
                // CA-CondMat large

                //CitationGraph graph = new CitationGraph();
                //graph.ReadFromFile("../../../../articles_data/idx_edges.txt");
                //graphSys.AddGraph(graph);
            }

            if (InputDevice.IsKeyDown(Keys.V))
            {
                var protGraph = new ProteinGraph();
                protGraph.ReadFromFile("../../../../signalling_table.csv");

                // add categories of nodes with different localization:
                // category 1 (membrane):
                graphSys.AddCategory(new List<int> { 0, 1, 2, 20 }, new Vector3(0, 0, 0), 700);

                // category 2 (cytoplasma):
                graphSys.AddCategory(new List<int> { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, new Vector3(0, 0, 0), 300);

                // category 3 (nucleus):
                graphSys.AddCategory(new List<int> { 8, 12, 13, 14, 15, 16, 17, 18, 19 }, new Vector3(0, 0, 0), 100);

                graphSys.AddGraph(protGraph);

            }

            //ds.Add(Color.Orange, "FPS {0}", gameTime.Fps);
            //ds.Add(Color.Orange, "F1   - show developer console");
            //ds.Add(Color.Orange, "F5   - build content and reload textures");
            //ds.Add(Color.Orange, "F12  - make screenshot");
            //ds.Add(Color.Orange, "ESC  - exit");
            //ds.Add(Color.Orange, "Press Z or X to load graph");
            //ds.Add(Color.Orange, "Press M to load painted graph (SLOW!)");
            //ds.Add(Color.Orange, "Press P to pause/unpause");
            //			ds.Add(Color.Orange, "Press I to switch to manual mode");

            base.Update(gameTime);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates game
        /// </summary>
        /// <param name="gameTime"></param>
        protected override void Update(GameTime gameTime)
        {
            var ds = GetService<DebugStrings>();
            var debRen = GetService<DebugRender>();

            var graphSys = GetService<GraphSystem>();

            if (InputDevice.IsKeyDown(Keys.X))
            {
                Graph graph = Graph.MakeTree(4096, 40);
                //		Graph<BaseNode> graph = Graph<BaseNode>.MakeRing( 512 );
                graphSys.AddGraph(graph);
            }

            if (InputDevice.IsKeyDown(Keys.Z))
            {
                //				StanfordNetwork graph = new StanfordNetwork();
                stNet = new StanfordNetwork();
                // TODO: add path file
                //stNet.ReadFromFile("../../../../Graf.txt");
                doctorToPatients = new Dictionary<Doctor, HashSet<Patient>>();
                Dictionary<string, int> dict = new Dictionary<string, int>();
                ReaderFiles.ReadFromFilePatientData("../../../../almazovdata", dict, doctorToPatients);
                //ReaderFiles.ReadEpisodeList = ("../../../../res");
                //ReaderFiles.ReadAndFindPatient();

                stNet.BuildGraphFromDictinary(doctorToPatients);
                graphSys.AddGraph(stNet);
            }

            if (InputDevice.IsKeyDown(Keys.V))
            {
                var protGraph = new ProteinGraph();
                protGraph.ReadFromFile("../../../../signalling_table.csv");

                // add categories of nodes with different localization:
                // category 1 (membrane):
                graphSys.AddCategory(new List<int> { 0, 1, 2, 20 }, new Vector3(0, 0, 0), 700);

                // category 2 (cytoplasma):
                graphSys.AddCategory(new List<int> { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, new Vector3(0, 0, 0), 300);

                // category 3 (nucleus):
                graphSys.AddCategory(new List<int> { 8, 12, 13, 14, 15, 16, 17, 18, 19 }, new Vector3(0, 0, 0), 100);

                graphSys.AddGraph(protGraph);

            }

            //ds.Add(Color.Orange, "FPS {0}", gameTime.Fps);
            //ds.Add(Color.Orange, "F1   - show developer console");
            //ds.Add(Color.Orange, "F5   - build content and reload textures");
            //ds.Add(Color.Orange, "F12  - make screenshot");
            //ds.Add(Color.Orange, "ESC  - exit");
            //ds.Add(Color.Orange, "Press Z or X to load graph");
            //ds.Add(Color.Orange, "Press M to load painted graph (SLOW!)");
            //ds.Add(Color.Orange, "Press P to pause/unpause");

            //			ds.Add(Color.Orange, "Press I to switch to manual mode");

            base.Update(gameTime);
        }