Ejemplo n.º 1
0
        public void ImportFromFile_Test()
        {
            foreach (TestData data in TestDatas)
            {
                string path   = data.Filename;
                Graph  actual = GraphLogic.ImportGraphFromFile(path);

                Assert.AreEqual(data.Graph, actual);
            }
        }
Ejemplo n.º 2
0
        public void ExportTofile_Test()
        {
            foreach (TestData data in TestDatas)
            {
                string path        = GetPathToTestFile("GRAPH_" + GetRandomString() + ".graph");
                string fileContent = GraphLogic.ExportGraphToFile(data.Graph, path);
                string actualHash  = GetHashForFile(path);

                Assert.AreEqual(data.Hash, actualHash);
            }
        }
Ejemplo n.º 3
0
    private void Start()
    {
        StartCoroutine(AddPlayerCO());

        refGL = FindObjectOfType <GraphLogic>();

        //Legge i dati da file
        readedData.AddRange(csvFile.text.Split(lineSeparater));

        //Metodo che passa il testo della domanda da file
        SetDataFromCSV();

        Invoke("CreateNewGameSession", 1f);
    }
Ejemplo n.º 4
0
        private void SetupGraph(int[,] AdjMatrix)
        {
            var logicCore = new GraphLogic();

            logicCore.DefaultLayoutAlgorithm       = LayoutAlgorithmTypeEnum.KK;
            logicCore.DefaultLayoutAlgorithmParams = logicCore.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.KK);
            ((KKLayoutParameters)logicCore.DefaultLayoutAlgorithmParams).MaxIterations = 100;

            logicCore.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;
            logicCore.DefaultOverlapRemovalAlgorithmParams.HorizontalGap = 80;
            logicCore.DefaultOverlapRemovalAlgorithmParams.VerticalGap   = 80;

            Area.SetVerticesHighlight(true, GraphControlType.VertexAndEdge, EdgesType.All);
            Area.SetEdgesHighlight(true, GraphControlType.VertexAndEdge);

            Area.LogicCore  = logicCore;
            logicCore.Graph = GenerateGraph(AdjMatrix);
        }