General idea
Concept
Some type of "playground" is required. We may employ Python's secret weapon.... lists,
We make a 100x100 two-dimensional array, thus the ARRAY variable gets the scope
\(arr[0-100][0-100]\)
It's easy to visualize the "playground" looking like a tic-tac-toe board. Instead of the 3x3 squares used in tic-tac-toe,
we use 100x100 squares instead to simulation land/hunting-ground."
This simulation is meant to simulate the relation between hunter and prey, and see how we can use natural selection,
or more technical fitness functions and mutation. This topics will be explain further down don't you worry.
TLDR (for people with no attention-span)
We put weight on certain attribtures depnding on how well they performed during the iteration.Example 01
Prey 01 survived with 150hp, but Prey 02 survived with 120hp. Prey01's genes are given a higher weight. We take the top half of the class and couple them up. This will generate two children with mutating DNA. Genes from both XX and XY will be found in the childern.End Goal
The ultimate objective is to see if the prey can outlast the hunter. Also I wanna see if prey can turn into hunters but that's for version 2.0Video Explanation (poor quality.)
Agents
Prey
I need to create an attribute list for prey. What every "fitness parameter" does in practice.Ex: If your speed attribute/rating is 52, for example. And I have a regulation that states if your speed is beyond 50, you...
Increase your chances of escaping an attack by 15%.
I need to declare this ahead of time so that I may adjust the fitenss/mutation subroutines more easily.
GEN POOL
Gen 0: Health (How much health tbey have.)Gen 1: Weight (How much damage they take)
Gen 2: attack power (This will always be 0)
Gen 3: Speed (How good they are at evading prey.)
Gen 4: Age (Decay)
Days Survived: How many iterations the prey has survived.
Enemy Close: How many times was the prey within X amount of blocks of hunter. (Day to day basis)
FITNESS FUNCTION
Hunter
GEN POOL
Gen 0: Health (How much health tbey have.)Gen 1: Weight (How much damage they take)
Gen 2: attack power (How much damage they do.)
Gen 3: Speed (How fast they perform damage.)
Gen 4: Age (Decay)
Feral Mode: Bool -> if the hunter kills at least three prey the night before.