Пример #1
0
        }                                                   // Constructor

        public void BuildGA(Petri p)
        {
            if (PROJECT)
            {
                p.UpdateLogs("Couldn't set GrauA up, because Project is already active");
                return;
            }
            p.CreateSlot("L1", 0);         // 0
            p.CreateSlot("L2", 0);         // 1
            p.CreateSlot("L3", 0);         // 2
            p.CreateSlot("L4", 0);         // 3
            p.CreateSlot("L5", 0);         // 4
            p.CreateSlot("L6", 0);         // 5
            p.CreateSlot("L7", 0);         // 6

            p.CreateTransition("T1");      // 0
            p.CreateTransition("T2");      // 1

            p.CreateConnectionST(0, 0, 2); // L1 to T1, weight 2
            p.CreateConnectionST(1, 0);    //  L2 to T1, weight 1
            p.CreateConnectionST(2, 0);    //  L3 to T1, weight 1

            p.CreateConnectionTS(4, 0, 3); // T1 to L5, weight 3
            p.CreateConnectionTS(6, 0);    //  T1 to L7, weight 1

            p.CreateConnectionST(3, 1);    // L4 to T2, weight 1
            p.CreateConnectionST(4, 1, 6); // L5 to T2, weight 6

            p.CreateConnectionTS(5, 1);    // T2 to L6, weight 1
            p.CreateConnectionTS(6, 1, 2); // T2 to L7, wight 2

            GA = true;
        }
Пример #2
0
        public void EvolexNet(Petri p)
        {
            if (GA)
            {
                p.UpdateLogs("Couldn't set Project up, because GrauA is already active");
                return;
            }
            p.CreateSlot("Carnivore Creatures", 0);                  // 0
            p.CreateSlot("Herbivore Creatures", 0);                  // 1
            p.CreateSlot("Prey", 0);                                 // 2
            p.CreateSlot("Fruit Trees", 0);                          // 3
            p.CreateSlot("Available Fruit", 0);                      // 4
            p.CreateSlot("Targeted Fruit", 0);                       // 5

            p.CreateTransition("Look For Prey");                     // 0
            p.CreateTransition("Look For Fruit");                    // 1
            p.CreateTransition("Move On (Carnivore)");               // 2
            p.CreateTransition("Attempt Escape (Herbivore)");        // 3
            p.CreateTransition("Spawn Fruits");                      // 4
            p.CreateTransition("Hunt Prey");                         // 5
            p.CreateTransition("Eat Fruit");                         // 6

            p.CreateConnectionST(0, 0);                              // Carnivore Creature to Look For Prey
            p.CreateConnectionST(0, 2);                              // Carnivore Creature to Idle (Carnivore)
            p.CreateConnectionST(1, 0);                              // Herbivore Creature to Look For Prey
            p.CreateConnectionST(1, 2, 1, ConnectionType.Inhibitor); // Herbivore Creature to Move On (Carnivore) - Inhibitor
            p.CreateConnectionST(1, 1);                              // Herbivore Creature to Look For Fruit
            p.CreateConnectionST(1, 3);                              // Herbivore Creature to Attempt Escape (Herbivore)
            p.CreateConnectionST(3, 4, 2);                           // Fruit Trees to Spawn Fruits - Weight 2
            p.CreateConnectionST(4, 1);                              // Available Fruit to Look For Fruit
            p.CreateConnectionST(4, 3, 1, ConnectionType.Inhibitor); // Available Fruit to Attempt Escape (Herbivore) - Inhibitor
            p.CreateConnectionST(2, 5);                              // Prey to Hunt Prey
            p.CreateConnectionST(5, 6);                              // Targeted Fruit to Eat Fruit

            p.CreateConnectionTS(2, 0);                              // Look For Prey to Prey
            p.CreateConnectionTS(0, 5);                              // Hunt Prey to Carnivore Creatures
            p.CreateConnectionTS(4, 4, 5);                           // Spawn Fruits to Available Fruits - Weight 5
            p.CreateConnectionTS(3, 4);                              // Spawn Fruits to Fruit Trees
            p.CreateConnectionTS(5, 1);                              // Look For Fruit to Targeted Fruit
            p.CreateConnectionTS(1, 6);                              // Eat Fruit to Herbivore Creatures

            PROJECT = true;
        }