The game is played on a NxN board where N is an odd number that follows the sequence of 1+4*x with x starnig from 1: 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, .... The game starts with a cat in the center of the board, and it starts with some random blocks placed randomly.
The game is played in turns, where each player can move the cat or a catcher.
All students enrolled in the competition will submit both agents. The agents will play against each other, and the winner will be the one that wins the most games.
The points will be counted as how many moves each one does;
I will create an automation that will use your agents to play against each other.
Place the interface below in a file called IAgent.h on the root of your repo;
Agents are stateless. At every turn, the state of all classes everything will be reset.
The classes should be named Cat and Catcher;
The simulator will include Cat.h and Catcher.h, so you should have at least these two files;
Both agents should inherit IAgent.h and include #include "IAgent.h";
All .cpp and .h files should be at the same directory level. Don't use subdirs;
Your submission will be a zip containing only .h and .cpp files.
Do not submit any file with a main function;
The reasoning is: I will create an automation for:
Receive your zip and version them for auditing purposes and diagnostics;
Create a folder for your user if not created yet;
Clear the folder and keep the executable;
Unzip the contents of your submission into a folder with your username;
Add a main.cpp for the simulator;
Compile the whole folder into one executable named as your username. Only the last working subimission will be kept;
It will generate N executables that will be managed and called via terminal to generate the final report with points;
The report will be generated via another automation that will generate 100 initial states randomly. All agents from all students play against each other.
executables = fetchAllExecutables()
initialstates = generateRandomStates(100);
foreach cat of executables{
foreach catcher of executables {
turnIsCat = true;
foreach state of initialstate {
while(nat have winner && correct output){
if(turnIsCat)
state = cat(state)
else
state = catcher(state)
turnIsCat = !turnIsCat
}
generate partial report from current cat and catcher
}
}
}
compose final report of the run
#pragma once#include<vector>#include<utility>// NO NOT CHANGE THIS FILEstructIAgent{public:/** * @brief the agent implementation. the center of the world is {0,0}, top left is {-sideSize/2, -sideSize/2} and the bottom right is {sideSize/2, sideSize/2}. * * @param world the world as a vector of booleans. true means there is a wall, false means there is no wall. The vector is the linearization of the matrix of the world. * @param catPos the position of the cat in the world {x,y} relative to the center of the world. * @param sideSize the side size of the world. it will be always a square that follows the sequence of 4*i+1: 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, ... * * @return the position to move to {x,y}. relative to the center of the world. */virtualstd::pair<int,int>move(conststd::vector<bool>&world,std::pair<int,int>catPos,intsideSize)=0;};