Exemple #1
0
 internal override void JudgeCreature(Creature selfCreature, Creature otherCreature) {
     // Calculate genetic disparity between self and vicitm
     value = Math.Abs(otherCreature.bodyR - selfCreature.bodyR);
     value += Math.Abs(otherCreature.bodyG - selfCreature.bodyG);
     value += Math.Abs(otherCreature.bodyB - selfCreature.bodyB);
     // Bound
     value = NeuralNet.sigmoid(value, 0, 3 * 255);
 }
Exemple #2
0
		internal override void Update(Creature creature, Map map) {
			// Look at it's own ore
			value = NeuralNet.sigmoid(creature.ore, 0, creature.property != null ? // Max sigmoid value = cost to improve a tile
														(creature.property.tileFoodImprovementNumerator + creature.property.tileOreImprovementNumerator) * 5 :
														10);	// If creature does not own a tile, default value is cost to improve a tile at level 1
			if(value == float.NaN) {
				throw new Exception();
			}
		}
Exemple #3
0
		internal override void Update(Creature creature, Map map) {
			// Get market price of ore
			float profit = 0;
			value = 0;
			foreach(Creature creatureResident in creature.currentTile.creatureResidentList) {
				profit = creature.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][5].value - creatureResident.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][5].value;
				if(profit > value) {
					value = profit;
				}
			}
			value = NeuralNet.sigmoid(value) - 500;
		}
Exemple #4
0
		internal override void Update(Creature creature, Map map) {
			// Get market price of food
			// Since we only ever buy, take the difference between selling and buying price
			float profit = 0;
			value = 0;
			foreach(Creature creatureResident in creature.currentTile.creatureResidentList) {
				profit = creature.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][4].value - creatureResident.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][4].value;
				if(profit > value) {
					value = profit;
				}
			}
			if(creature.Equals(map.selectedCreature) && value > 0) {
				Console.WriteLine("Profit: {0}", value);
			}
			value = NeuralNet.sigmoid(value) - 500;
			//value = creature.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][4].value;	// Default buy value is our own sell value
			//foreach(Creature creatureResident in creature.currentTile.creatureResidentList) {
			//	if(creatureResident.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][4].value < value) {
			//		value = creatureResident.mainNet.nodeList[creature.mainNet.nodeList.Count - 1][4].value;
			//	}
			//}
		}