예제 #1
0
        /// <summary>
        ///     Initiates the Aras export and .dot graph creation and export.
        /// </summary>
        /// <remarks>
        ///     Only gets called if the command line arguments were parsed successfully.
        /// </remarks>
        /// <param name="options">The <see cref="ArgOptions"/> the program was started with.</param>
        private static void RunOptionsAndPerformLogic(ArgOptions options)
        {
            var arasExport   = PerformArasExport(options);
            var graphCreator = new GraphCreator(arasExport);

            graphCreator.CreateGraph(options.RelsAsClasses);
            graphCreator.ExportGraph(options.FilePath ?? @"C:\temp\temp.dot");
        }
예제 #2
0
        public void T()
        {
            var dir      = @"D:\workde\BOA.BusinessModules\Dev\BOA.Card.CreditCardOperation\UI\BOA.UI.Card.CreditCardOperation\bin\Debug\";
            var resolver = new DefaultAssemblyResolver();

            resolver.AddSearchDirectory(dir);


            var dllPath = dir + "BOA.UI.Card.CreditCardOperation.dll";

            var api = new GraphCreator();

            var assemblyDefinition = AssemblyDefinition.ReadAssembly(dllPath, new ReaderParameters {
                AssemblyResolver = resolver
            });

            var typeDefinition = assemblyDefinition.FindType(type => type.FullName == "BOA.UI.Card.CreditCardOperation.LimitChangeForm.Model");

            api.CreateGraph(typeDefinition);
        }
예제 #3
0
    void OnButtonClick(ButtonID id)
    {
        switch (id)
        {
        case ButtonID.VelocityGraph:
        {
            TogglePanel(1);
            selectedGraph  = SelectedGraph.VelocityGraph;
            titleText.text = "Velocity";
            unitsText.text = "(m/s)";
            graphCreator.CreateGraph();
            break;
        }

        case ButtonID.AccelerationGraph:
        {
            TogglePanel(1);
            selectedGraph  = SelectedGraph.AccelerationGraph;
            titleText.text = "Acceleration";
            unitsText.text = "(m/s^2)";
            graphCreator.CreateGraph();
            break;
        }

        case ButtonID.PositionGraph:
        {
            TogglePanel(1);
            selectedGraph  = SelectedGraph.PositionGraph;
            titleText.text = "Displacement";
            unitsText.text = "(m)";
            graphCreator.CreateGraph();
            break;
        }

        case ButtonID.InfoBack:
        {
            TogglePanel(0);
            break;
        }
        }
    }
예제 #4
0
    // Start is called before the first frame update
    void Start()
    {
        #region Teste Grafo

        /*
         * Graph<string> web = new Graph<string>();
         *
         * web.AddNode("Privacy.htm");
         * web.AddNode("People.aspx");
         * web.AddNode("About.htm");
         * web.AddNode("Index.htm");
         * web.AddNode("Products.aspx");
         * web.AddNode("Contact.aspx");
         *
         * web.AddDirectedEdge("People.aspx", "Privacy.htm");  // People -> Privacy
         *
         * web.AddDirectedEdge("Privacy.htm", "Index.htm");    // Privacy -> Index
         * web.AddDirectedEdge("Privacy.htm", "About.htm");    // Privacy -> About
         *
         * web.AddDirectedEdge("About.htm", "Privacy.htm");    // About -> Privacy
         * web.AddDirectedEdge("About.htm", "People.aspx");    // About -> People
         * web.AddDirectedEdge("About.htm", "Contact.aspx");   // About -> Contact
         *
         * web.AddDirectedEdge("Index.htm", "About.htm");      // Index -> About
         * web.AddDirectedEdge("Index.htm", "Contact.aspx");   // Index -> Contacts
         * web.AddDirectedEdge("Index.htm", "Products.aspx");  // Index -> Products
         *
         * web.AddDirectedEdge("Products.aspx", "Index.htm");  // Products -> Index
         * web.AddDirectedEdge("Products.aspx", "People.aspx");// Products -> People
         *
         *
         * var path = web.BFS("About.htm", "People.aspx");
         * Debug.Log(string.Join(" <- ", path));
         * path = web.BFS("About.htm", "Products.aspx");
         * Debug.Log(string.Join(" <- ", path));
         * string pathS = string.Join(",", path);
         * Debug.Log(pathS.Split(',')[0]);
         */
        #endregion

        #region Teste ProjectPet

        //Graph<string> petAccess = new Graph<string>();

        //GraphNode<string> kitchen = new GraphNode<string>("Kitchen");
        //GraphNode<string> yard = new GraphNode<string>("Yard");
        //GraphNode<string> livingRoom = new GraphNode<string>("LivingRoom");

        //petAccess.AddNode(kitchen);
        //petAccess.AddNode(yard);
        //petAccess.AddNode(livingRoom);

        //petAccess.AddDirectedEdge(livingRoom, yard, -2723);
        //petAccess.AddDirectedEdge(livingRoom, kitchen, 2708);

        //petAccess.AddDirectedEdge(kitchen, livingRoom, 812);

        //petAccess.AddDirectedEdge(yard, livingRoom, 2431);

        //Debug.LogWarning("Caminho do quintal até a cozinha");
        //var path = petAccess.BFS(yard.Value, kitchen.Value);
        //string pathS = HasHSetToString(path);
        ////PrintPath(pathS.Split(','));
        //string[] name = pathS.Split(',');
        //for (int i = name.Length - 1; i > 0; i--)
        //{
        //    Debug.Log(name[i] + " -> " + petAccess.teste(name[i], name[i - 1]));
        //}

        /*
         * Debug.LogWarning("Caminho da sala até a cozinha");
         * path = petAccess.BFS(livingRoom.Value, kitchen.Value);
         * pathS = HasHSetToString(path);
         * PrintPath(pathS.Split(','));
         *
         * Debug.LogWarning("Caminho do quintal até a sala");
         * path = petAccess.BFS(yard.Value, livingRoom.Value);
         * pathS = HasHSetToString(path);
         * PrintPath(pathS.Split(','));
         */
        #endregion

        petAccess.CreateGraph();
        var    path  = petAccess.petAccessGraph.BFS("Yard", "Kitchen");
        string pathS = HasHSetToString(path);
        //PrintPath(pathS.Split(','));
        string[] name = pathS.Split(',');
        for (int i = name.Length - 1; i > 0; i--)
        {
            Debug.Log(name[i] + " -> " + petAccess.petAccessGraph.GetGraphCost(name[i], name[i - 1]));
        }
    }