Hide

# Problem EFishing derby: HMM

## Game Concept

Though this is a one-person version of the game, the game could also be played in a two-player simultaneous mode and was designed as an Atari TV-video game. The original game was about fishermen reeling in fish, before the local shark could get a hold of them. The first to reach 99 lb. of fish would win. Our Fishing Derby is a generalized version of the old Atari game, where we see an underwater environment with silhouettes of fish swimming, until their species is identified and they become painted in color. The player has to observe the movement patterns of the fish and eventually guess for the correct species. If the guess is correct, the player will gain one point. The game is over when the player has guessed 70 times for different species.

Guessing is optional, you will choose to guess or not for each fish. The score will be unaffected if no guessing is made. You will get to know the correct species for each fish you make a guess on regardless of whether your guess was correct or not.

## Gameplay specifics

The water is considered flat and the fish can move in the eight basic directions (up, down, left, right, up-left, up-right, down-left, down-right). They do not have absolute positions as far as you are concerned. Only the direction of the movement is important. Every fish in the water makes a move for every discrete time step that the game runs (corresponding to one call of guess() in the player file).

The fish have different swimming patterns. A particular species displays only a few swimming patterns and different species may have different variations of them.

The goal of the game is to correctly identify the species of as many fish as possible. The game is divided into several environments. The different environments contain different distributions of fish and the fish may also behave differently in different environments. In particular, the fish will be completely different on Kattis compared to in your sample data.

Each game contains 70 fish and has a maximal duration of 180 time steps. The game will end when the player has made a guess 70 times. The program will be restarted between each game, so you cannot transfer any information between them. The final score is the total number of correctly guessed fish across all environments tested on Kattis.

For more details, please refer to the code inside the provided skeletons.

## Provided code

A basic program will be provided for you in Python. The program, as it is provided, is fully functional, but never guesses.

You should modify the player file and you may also create new files. The files included in the skeleton, other than player.py, may be modified locally but keep in mind that they will be overwritten on Kattis. You only need to upload the player file, and of course any additional python files you have created.

Python code skeleton available in the attachments. You can check the installation instructions in the text file README.md.

In this assignment, the numpy library is available. However, having a lot of numpy operations may severely increase the running time of the program under PyPy compilation, so it is highly suggested to use python lists and self-defined matrix operation instead.

## Input

Your interface with the judge is the player file. A sample input is provided in the code skeleton (sequences.json).

The guess method of the player file will be called for each time step. The number of the iteration and a list containing one movement per fish for the concerned time step are passed as arguments to this function.

The reveal function of the player file is called if a guess is made, and will reveal the species for the fish you made guesses for.

The player should spend less than 5 seconds on each time step before returning a guess, otherwise the evaluation of the code will stop with a run time error.

## Output

The skeleton handles all the output for you. Avoid using stdin and stdout. (Use stderr for debugging.)

Please log in to submit a solution to this problem