Esempio n. 1
0
        public ClarionAgent(WSProxy nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            mind         = new MindViewer();
            mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputWallAhead  = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            inputFoodAhead  = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputJewelAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AHEAD);
            inputNeedJewel  = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_NEED_JEWEL);


            // Initialize Output actions
            outputRotateClockwise = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            outputGoAhead         = World.NewExternalActionChunk(CreatureActions.GO_AHEAD.ToString());
            outputGetJewel        = World.NewExternalActionChunk(CreatureActions.GET_JEWEL.ToString());
            outputEatFood         = World.NewExternalActionChunk(CreatureActions.EAT_FOOD.ToString());
            outputGoToJewel       = World.NewExternalActionChunk(CreatureActions.GO_TO_JEWEL.ToString());

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }
Esempio n. 2
0
        public ClarionAgent(WSProxy nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            mind         = new MindViewer();
            mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputWallAhead      = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            inputFoodAhead      = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputJewelAhead     = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AHEAD);
            inputDistantJewel   = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_DISTANT_JEWEL);
            inputDistantFood    = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_DISTANT_FOOD);
            inputDeliverLeaflet = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_DELIVER_LEAFLET);

            // Initialize Output actions
            outputRotateClockwise = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            //outputGoAhead = World.NewExternalActionChunk(CreatureActions.GO_AHEAD.ToString());
            outputGoToClosestJewel = World.NewExternalActionChunk(CreatureActions.GO_TO_CLOSEST_JEWEL.ToString());
            outputGoToClosestFood  = World.NewExternalActionChunk(CreatureActions.GO_TO_CLOSEST_FOOD.ToString());
            outputEatFood          = World.NewExternalActionChunk(CreatureActions.EAT_FOOD.ToString());
            outputSackJewel        = World.NewExternalActionChunk(CreatureActions.SACK_JEWEL.ToString());
            outputDeliverLeaflet   = World.NewExternalActionChunk(CreatureActions.PREPARE_TO_DELIVER_LEAFLET.ToString());
            outputStop             = World.NewExternalActionChunk(CreatureActions.STOP.ToString());

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }
Esempio n. 3
0
        public ClarionAgent(WorldServer nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            //mind = new Mind();
            //mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputWallAhead            = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            inputFoodAhead            = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputLeafletJewelAhead    = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_LEAFLET_JEWEL_AHEAD);
            inputNonLeafletJewelAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_NON_LEAFLET_JEWEL_AHEAD);
            inputCloseObjectAhead     = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_CLOSE_OBJECT_AHEAD);
            inputHasCompletedLeaflet  = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_HAS_COMPLETED_LEAFLET);


            // Initialize Output actions
            outputRotateClockwise = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            outputGoAhead         = World.NewExternalActionChunk(CreatureActions.GO_AHEAD.ToString());
            outputEat             = World.NewExternalActionChunk(CreatureActions.EAT.ToString());
            outputHide            = World.NewExternalActionChunk(CreatureActions.HIDE.ToString());
            outputSack            = World.NewExternalActionChunk(CreatureActions.SACK.ToString());
            outputStop            = World.NewExternalActionChunk(CreatureActions.STOP.ToString());

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }
Esempio n. 4
0
        public ClarionAgent(WSProxy nws, String creature_ID, String creature_Name, List <Leaflet> leafletList)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            mind         = new MindViewer();
            mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputWallCreatureAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            inputFoodAhead         = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputJewelAhead        = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AHEAD);
            inputJewelInVision     = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_IN_VISION);
            inputFuelLow           = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FUEL_LOW);

            // Initialize Output actions
            outputRotateClockwise   = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            outputGoAhead           = World.NewExternalActionChunk(CreatureActions.GO_AHEAD.ToString());
            outputEatFood           = World.NewExternalActionChunk(CreatureActions.EAT_FOOD.ToString());
            outputGetJewel          = World.NewExternalActionChunk(CreatureActions.GET_JEWEL.ToString());
            outputHideJewel         = World.NewExternalActionChunk(CreatureActions.HIDE_JEWEL.ToString());
            outputGoalAchieved      = World.NewExternalActionChunk(CreatureActions.GOAL_ACHIEVED.ToString());
            outputGoToJewelInVision = World.NewExternalActionChunk(CreatureActions.GO_TO_JEWEL.ToString());
            outputFuelLow           = World.NewExternalActionChunk(CreatureActions.FUEL_LOW.ToString());

            //List<Thing> listThing = nws.SendGetCreatureState (creature_ID);

            //IList<Thing> response = null;

            //if (worldServer != null && worldServer.IsConnected) {
            //	response = worldServer.SendGetCreatureState (creatureName);
            //		Creature cc = (Creature)response [0];
            //		leaflet1.leafletID = cc.leaflets [0].leafletID;
            //		leaflet2.leafletID = cc.leaflets [1].leafletID;
            //		leaflet3.leafletID = cc.leaflets [2].leafletID;
            //		Console.WriteLine ("Creature found: " + cc.Name);
            //		Console.WriteLine ("LF1: " + cc.leaflets [0].leafletID);
            //		Console.WriteLine ("LF2: " + cc.leaflets [1].leafletID);
            //		Console.WriteLine ("LF3: " + cc.leaflets [2].leafletID);
            //}

            // Load leaflet control
            loadLeafletsControl(leafletList);
            mind.loadLeaflet(leafletList[0], leafletList[1], leafletList[2]);

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            //Console.WriteLine ("Agent started");
        }
Esempio n. 5
0
        public ClarionAgent(WSProxy nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            mind         = new MindViewer();
            mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputWallCreatureAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            inputFoodAhead         = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputJewelAhead        = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AHEAD);
            inputJewelInVision     = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_IN_VISION);

            // Initialize Output actions
            outputRotateClockwise   = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            outputGoAhead           = World.NewExternalActionChunk(CreatureActions.GO_AHEAD.ToString());
            outputEatFood           = World.NewExternalActionChunk(CreatureActions.EAT_FOOD.ToString());
            outputGetJewel          = World.NewExternalActionChunk(CreatureActions.GET_JEWEL.ToString());
            outputHideJewel         = World.NewExternalActionChunk(CreatureActions.HIDE_JEWEL.ToString());
            outputGoalAchieved      = World.NewExternalActionChunk(CreatureActions.GOAL_ACHIEVED.ToString());
            outputGoToJewelInVision = World.NewExternalActionChunk(CreatureActions.GO_TO_JEWEL.ToString());

            /*List<Thing> thingList = nws.SendGetCreatureState (creature_ID);
             * foreach(Thing t in thingList) {
             *      Console.WriteLine ("Thing: ");
             *      Console.Write (t);
             * }*/



            // Define jewels out of scope
            jewelOutOfScope.Add("Orange");
            jewelOutOfScope.Add("DarkGray_Spoiled");

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }
Esempio n. 6
0
        // To indicate we are done.
        //Boolean allJewelsCollected = false;
        //Boolean reachedDeliverySpot = false;
        #endregion

        #region Constructor
        public ClarionAgent(WSProxy nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            mind         = new MindViewer();
            mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Create a (fake) delivery spot.
            // It seems WSProxy.cs does not support it, so place it at (0,0).
            deliverySpot    = new Thing();
            deliverySpot.X1 = 0;
            deliverySpot.Y1 = 0;

            // Initialize Input Information
            inputWallAhead          = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            inputJewelAhead         = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AHEAD);
            inputFoodAhead          = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputJewelAway          = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AWAY);
            inputFoodAway           = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AWAY);
            inputAllJewelsCollected = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_ALL_JEWELS_COLLECTED);
            inputCreatureCanDeliver = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_CREATURE_CAN_DELIVER);

            // Initialize Output actions
            outputRotateClockwise  = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            outputGetJewel         = World.NewExternalActionChunk(CreatureActions.GET_JEWEL.ToString());
            outputGetFood          = World.NewExternalActionChunk(CreatureActions.GET_FOOD.ToString());
            outputGoToJewel        = World.NewExternalActionChunk(CreatureActions.GO_TO_JEWEL.ToString());
            outputGoToFood         = World.NewExternalActionChunk(CreatureActions.GO_TO_FOOD.ToString());
            outputWander           = World.NewExternalActionChunk(CreatureActions.WANDER.ToString());
            outputGoToDeliverySpot = World.NewExternalActionChunk(CreatureActions.GO_TO_DELIVER.ToString());
            outputDoDelivery       = World.NewExternalActionChunk(CreatureActions.DELIVER.ToString());

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }
Esempio n. 7
0
        /// <summary>
        /// Output action that makes the agent go ahead
        /// </summary>

        #endregion

        #endregion

        #region Constructor
        public ClarionAgent(WorldServer nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            mind         = new Mind();
            mind.Show();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_AHEAD);

            inputGoItem = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_GO_ITEM);

            inputSackItItem = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_SACKIT_ITEM);

            inputEatItem = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_EAT_ITEM);

            inputStopCreature = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_STOP_CREATURE);

            // Initialize Output actions
            outputRotateClockwise = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());

            outputGoItem = World.NewExternalActionChunk(CreatureActions.GO_ITEM.ToString());

            outputSackItItem = World.NewExternalActionChunk(CreatureActions.SACKIT_ITEM.ToString());

            outputEatItem = World.NewExternalActionChunk(CreatureActions.EAT_ITEM.ToString());

            outputStopCreature = World.NewExternalActionChunk(CreatureActions.STOP_CREATURE.ToString());


            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }
Esempio n. 8
0
        /// </summary>
        /// <param name="nws"></param>
        /// <param name="creature_ID"></param>
        /// <param name="creature_Name"></param>
        #endregion


        #region Constructor
        public ClarionAgent(WorldServer nws, String creature_ID, String creature_Name)
        {
            worldServer = nws;
            // Initialize the agent
            CurrentAgent = World.NewAgent("Current Agent");
            // FMT 15/06 - temp disable mind
            //mind = new Mind();
            //mind.Show ();
            creatureId   = creature_ID;
            creatureName = creature_Name;

            // Initialize Input Information
            inputWallAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_WALL_AHEAD);
            // FMT 29/04/2017
            inputFoodAhead         = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_FOOD_AHEAD);
            inputJewelAhead        = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_AHEAD);
            inputLeafletJewelAhead = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_LEAFLET_JEWEL_AHEAD);
            inputJewelHide         = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_JEWEL_HIDE);
            inputEnergyLow         = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_ENERGY_LOW);
            inputCloseObject       = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_CLOSE_OBJECT);
            inputLeafletComplete   = World.NewDimensionValuePair(SENSOR_VISUAL_DIMENSION, DIMENSION_LEAFLET_COMPLETE);

            // Initialize Output actions
            outputRotateClockwise = World.NewExternalActionChunk(CreatureActions.ROTATE_CLOCKWISE.ToString());
            outputGoAhead         = World.NewExternalActionChunk(CreatureActions.GO_AHEAD.ToString());
            // FMT 29/04/2017
            outputEat  = World.NewExternalActionChunk(CreatureActions.EAT.ToString());
            outputGet  = World.NewExternalActionChunk(CreatureActions.GET.ToString());
            outputGoTo = World.NewExternalActionChunk(CreatureActions.GO_TO.ToString());
            outputHide = World.NewExternalActionChunk(CreatureActions.HIDE.ToString());
            outputStop = World.NewExternalActionChunk(CreatureActions.STOP.ToString());

            //Create thread to simulation
            runThread = new Thread(CognitiveCycle);
            Console.WriteLine("Agent started");
        }