public static int initialPolicyPicks(WriteAtClass writer) { int counter = 0; int columnNumber = 5; int rowNumber = 4; int stateCount = 100; //Perhaps in the future I'll let the user edit this. for (int i = 0; i < stateCount; i++) { counter++; writer.WriteAt(" EQ ", columnNumber, rowNumber); columnNumber = columnNumber + 9; if (columnNumber == 95) { columnNumber = 5; rowNumber = rowNumber + 6; } } //Upon success return 0 return 0; }
public static int moveAgent(WriteAtClass writer, int currentCol, int currentRow, string direction) { //Delete wherever the agent was. writer.WriteAt(" ", currentCol, currentRow); //Direction taken to move the agent will be taken into account here. if (direction == "right") { currentCol = currentCol + 9; } if (direction == "left") { currentCol = currentCol - 9; } if (direction == "down") { currentRow = currentRow + 6; } if (direction == "up") { currentRow = currentRow - 6; } //Whatever the change is, now write it. writer.WriteAt("*AGENT*", currentCol, currentRow); //Return with success. return 0; }
//This code has a particular agent involved with itself. This is going to be how the agent is printed public static int firstAgentPrint(WriteAtClass writer) { writer.WriteAt("*AGENT*",4,2); return 0; }
public static int statePrint(WriteAtClass writer) { int counter = 0; int columnNumber = 4; int rowNumber = 0; int stateCount = 100; //Perhaps in the future I'll let the user edit this. for (int i = 0; i < stateCount; i++) { counter++; writer.WriteAt("State " + counter.ToString(), columnNumber, rowNumber); columnNumber = columnNumber + 9; if(columnNumber == 94) { columnNumber = 4; rowNumber = rowNumber + 6; } } return 0; }