ACatastrophicBing / CS-4243-Assignment-2

Genetic Algorithm for Introduction to AI With Joseph Beck
0 stars 0 forks source link

Puzzle 2 #2

Open ACatastrophicBing opened 2 years ago

ACatastrophicBing commented 2 years ago

Towers are composed of pieces. Each piece is represented in one line (tab delimited). Pieces have the following properties: Type: either door, wall, or lookout (String) Width: how wide the piece is (Natural) Strength: how many pieces can be stacked on top of it (Natural) Cost: how expensive it is to use this piece in a tower (Natural) Each piece may be used at most once. Towers are composed of a collection of pieces stacked on top of each other. Towers must obey the physics of the world:
Towers must have a door as their bottom-most piece. The top piece in a tower must be a lookout. Pieces between the top and bottom of a tower, if any, must be wall segments. I.e., towers can only have one door and one lookout.
A piece in a tower can, at most, be as wide as the piece below it. A piece in a tower can support its strength value in pieces placed above it. Towers that do not follow those rules are worthless as they will either collapse or are not usable by their future owners. Unfortunately, your GA does not know the physics of the world ahead of time or people’s preferences. It must build a tower to see that that tower has a fitness of 0. Therefore, you should not use those rules for the seeding the initial population. Part of this problem is for your agent to discover the rules of the world.
The score of a tower is (10+height2 – piece cost to build the tower). A tower that violates any of the above 5 constraints receives 0 points. A tower of height 2 with a door on the bottom and lookout on the top is a legal tower.

ACatastrophicBing commented 2 years ago

Population Size: piecenum^piecenumsize Randomly generated towers sizes 1:piecenum Fitness Function: Tower Score Selection Rule: Getting rid of lowest score towers Crossover: Randomly Mutation: Use a random and threshold to randomly mutate a floor Anytime Performance(Time): We can change that up later