// FMT 15/06/2017 private double FixedRuleToGoTo(ActivationCollection currentInput, Rule target) { // Here we will make the logic to go ahead return(((currentInput.Contains(inputFoodAhead, CurrentAgent.Parameters.MAX_ACTIVATION)) || (currentInput.Contains(inputLeafletJewelAhead, CurrentAgent.Parameters.MAX_ACTIVATION)) || (currentInput.Contains(inputJewelAhead, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleFuelLow(ActivationCollection currentInput, Rule target) { //// Here we will make the logic to go to food //if ((currentInput.Contains (inputWallCreatureAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && // (currentInput.Contains (inputFoodAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && // (currentInput.Contains (inputJewelAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && // (currentInput.Contains (inputJewelInVision, CurrentAgent.Parameters.MIN_ACTIVATION)) && // (currentInput.Contains (inputFuelLow, CurrentAgent.Parameters.MAX_ACTIVATION)) && // //(getJewelRemainingTotal () != jewelGoal)) { // (!exchangeJewels)) { // return 1.0; //} else { // return 0.0; //} // Here we will make the logic to go to food if ((currentInput.Contains(inputWallCreatureAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputFoodAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputJewelAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (fuelLow) && (!exchangeJewels)) { //Console.WriteLine ("Fixed Rule Support Fuel Low"); return(1.0); } else { return(0.0); } }
private double FixedRuleToAvoidCollisionWall(ActivationCollection currentInput, Rule target) { // See partial match threshold to verify what are the rules available for action selection return(((currentInput.Contains(inputCloseObject, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputFoodAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputLeafletJewelAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputJewelAhead, CurrentAgent.Parameters.MIN_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToEatFood(ActivationCollection currentInput, Rule target) { // Here we will make the logic to go ahead if ((currentInput.Contains(inputWallCreatureAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputFoodAhead, CurrentAgent.Parameters.MAX_ACTIVATION)) && (currentInput.Contains(inputJewelAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputJewelInVision, CurrentAgent.Parameters.MIN_ACTIVATION)) && (getJewelRemainingTotal() != jewelGoal)) { return(1.0); } else { return(0.0); } }
private double FixedRuleToWander(ActivationCollection currentInput, Rule target) { // Here we will make the logic to wander - check for low activation // in all inputs. if (currentInput.Contains(inputWallAhead, MIN_ACT_VAL) && currentInput.Contains(inputJewelAhead, MIN_ACT_VAL) && currentInput.Contains(inputFoodAhead, MIN_ACT_VAL) && currentInput.Contains(inputJewelAway, MIN_ACT_VAL) && currentInput.Contains(inputFoodAway, MIN_ACT_VAL)) { return(1.0); } else { return(0.0); } }
/// <summary> /// The training equation that is used to train the BP network in the bottom level of the NACS /// </summary> /// <param name="input"></param> /// <param name="output"></param> static void trainerEQ(ActivationCollection input, ActivationCollection output) { //If the input is the "lives in water" property, the activations for each chunk are as follows: if (input.Contains(World.GetDimensionValuePair("lives in", "water"), 1)) { output[World.GetDeclarativeChunk("Tuna")] = 1; //Tunas and whales live in water output[World.GetDeclarativeChunk("Whale")] = 1; output[World.GetDeclarativeChunk("Bear")] = .5; //Bears don't exactly live in water, but they do spend some time in it } //If the input is the "eats fish" property, the activations for each chunk are as follows: else if (input.Contains(World.GetDimensionValuePair("eats", "fish"), 1)) { output[World.GetDeclarativeChunk("Tuna")] = .2; //Tuna aren't really known to eat other fish (although they may eat smaller fish) output[World.GetDeclarativeChunk("Whale")] = .75; //Whales definitely eat other fish (although not exclusively) output[World.GetDeclarativeChunk("Bear")] = 1; //Everyone knows bears love salmon! } }
private double FixedRuleToGoToJewel(ActivationCollection currentInput, Rule target) { // Here we will make the logic to go ahead if ((currentInput.Contains(inputWallCreatureAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputFoodAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputJewelAhead, CurrentAgent.Parameters.MIN_ACTIVATION)) && (currentInput.Contains(inputJewelInVision, CurrentAgent.Parameters.MAX_ACTIVATION)) && (currentInput.Contains(inputFuelLow, CurrentAgent.Parameters.MIN_ACTIVATION)) && (isDesiredJewel(currentJewel.Material.Color)) && (getJewelRemainingTotal() != jewelGoal)) { // (!exchangeJewels)) { return(1.0); } else { return(0.0); } }
private double FixedRuleToSackJewel(ActivationCollection currentInput, Rule target) { // Here we will make the logic to sack jewel return(((currentInput.Contains(inputJewelAhead, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToEatFood(ActivationCollection currentInput, Rule target) { // Here we will make the logic to eat food return(((currentInput.Contains(inputFoodAhead, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToGoToClosestFood(ActivationCollection currentInput, Rule target) { // Here we will make the logic to go to food return(((currentInput.Contains(inputDistantFood, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToSackItItem(ActivationCollection currentInput, Rule target) { // See partial match threshold to verify what are the rules available for action selection return(((currentInput.Contains(inputSackItItem, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
public double RuleSupport(ActivationCollection currentInput, Rule target = null) { return(((currentInput.Contains(sayCooperate, 1.0) && target.OutputChunk == wmuacC) || (currentInput.Contains(sayDefect, 1.0) && target.OutputChunk == wmuacD)) ? 1.0 : 0.0); }
public bool QNetEligibility(ActivationCollection currentInput = null, ClarionComponent target = null) { return((currentInput.Contains(sayWhat, 1.0)) ? true : false); }
private double FixedRuleToGoToFood(ActivationCollection currentInput, Rule target) { // Here we will make the logic to eat food return(((currentInput.Contains(inputFoodAway, FOOD_AWAY_ACT_VAL))) ? 1.0 : 0.0); }
private double FixedRuleToStop(ActivationCollection currentInput, Rule target) { // Here we will make the logic to hide thing return(((currentInput.Contains(inputLeafletComplete, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToHide(ActivationCollection currentInput, Rule target) { // Here we will make the logic to hide thing return(((currentInput.Contains(inputCloseObject, CurrentAgent.Parameters.MAX_ACTIVATION)) && (currentInput.Contains(inputJewelHide, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToGoToDeliverySpot(ActivationCollection currentInput, Rule target) { // Check if all jewels collected. return(((currentInput.Contains(inputAllJewelsCollected, ALL_JEWELS_COLLECTED_ACT_VAL))) ? 1.0 : 0.0); }
private double FixedRuleToDeliver(ActivationCollection currentInput, Rule target) { return(((currentInput.Contains(inputCreatureCanDeliver, CREATURE_CAN_DELIVER_ACT_VAL))) ? 1.0 : 0.0); }
private double FixedRuleToDeliverLeaflet(ActivationCollection currentInput, Rule target) { // Here we will make the logic to deliver a leaflet return(((currentInput.Contains(inputDeliverLeaflet, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToGoAhead(ActivationCollection currentInput, Rule target) { // Here we will make the logic to go ahead return(((currentInput.Contains(inputNeedJewel, CurrentAgent.Parameters.MIN_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToGoToJewel(ActivationCollection currentInput, Rule target) { // Here we will make the logic to collect a jewel return(((currentInput.Contains(inputJewelAway, JEWEL_AWAY_ACT_VAL))) ? 1.0 : 0.0); }
private double FixedRuleToAvoidCollisionWall(ActivationCollection currentInput, Rule target) { // See partial match threshold to verify what are the rules available for action selection return(((currentInput.Contains(inputWallCreatureAhead, CurrentAgent.Parameters.MAX_ACTIVATION))) ? 1.0 : 0.0); }
private double FixedRuleToAvoidCollisionWall(ActivationCollection currentInput, Rule target) { // See partial match threshold to verify what are the rules available for action selection return(((currentInput.Contains(inputWallAhead, WALL_AHEAD_ACT_VAL))) ? 1.0 : 0.0); }