Elevator Input Files
For the Core, you may have used only the two files in the starter code - new.in and save.in. To test your AI for the Reach, you will want to use a variety of game input files.
Loading different files
How to load a different input file to play a different game.
- Delete the contents of save.in
- Make sure it is the correct file, in the directory where VS or Xcode will attempt to open files.
- XCode: make sure to set your Scheme to the folder that contains the .in files according to these instructions
- Visual Studio: make sure your .in files are stored in the same folder that your project is in. You should see files that end in .vcxproj in this folder (these are the files that Visual Studio creates when you make a new project)
- Copy contents from another file, such as randomGame.in, and paste them into save.in.
- Sample input files can be found in the starter files, and can also be downloaded here
- Do not forget to save the file.
- Run the game in your IDE.
1 Load save game
What is in an input file
0 0 0 0 0 0 0w 0w 0w 2f4t0a3 2f3t0a0 2f9t1a2 4f6t0a3 5f1t0a1 7f7t3a2 11f8t0a1 11f9t0a0 11f3t2a0
The first six rows correspond to the values, in order, from
int sumIndex; int sumUpRequest; int sumDownRequest; int sumExploded; int sumIdle; int timeReached;
The next three rows are starting states for the elevators:
0w -> floor 0, waiting (not servicing)
The remaining rows are people:
Represents the data for a Person class instance:
11 - turn 11 f8 - currentFloor 8 t0 - targetFloor 0 a1 - angerLevel 1
Assumptions about file contents
- Persons from the file cannot be added to the Building until time reaches the appropriate turn.
- The people are sorted in order of turn in the file: each subsequent row after the first must have the same or greater value for turn as the row before it.
- There may be 0, 1, or more people at any given turn.
- The maximum turn in any test file is 99.
- The starting state of satisfactionIndex and elevator values is present to enable the save game functionality, but this is not required for the Core or Reach.
- Students will not implement the Game::saveGame function.