Earn Higher Grades With Instant Assignment Help.Ask Question!

Python Programming
(5/5)

In this programming assignment, you are tasked with implementing a Checkers AI agent, which should be able to solve a Checkers game. You will have the choice of programming in Python.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
  1. Introduction

In this programming assignment, you are tasked with implementing a Checkers AI agent, which should be able to solve a Checkers game. You will have the choice of programming in Python. A code base will be made available to you, and you are asked to edit one or more files from whichever shell you choose to use. Your agent should be able to read percepts and act rationally; your grade will be determined by your agent’s performance measure. At the end of the quarter, your agent will compete against your classmates’ agents in a class tournament.    

Checkers World Game Mechanics

Environment

This shell follows the American/British ruleset for Checkers. Found on https://en.wikipedia.org/wiki/English_draughts. The rules are similar except the Checkers board in this shell can have a variable size governed by the following rules:

Board Parameters:

 

M = number of rows

N = number of columns

P = number of rows occupied by pieces in the initial state

Q = number of unoccupied rows that separate the two sides in the initial state

Parameter Constraints:

Q > 0

M = 2P + Q

N*P is even

 

Actuators

Your AI will ONLY know what move your opponent just made. If your AI moves first, you will receive a Move object with col = -1, row = -1

Sensors

Your AI should return a Move object to tell the shell which step you are going to make. For more information, please read the shell manual.

 

Program Your AI

Once you have your environment setup, you can start to program your agent. In the ‘src’ folder of your shell you will find the source code of the project. You are only allowed to make changes to the StudentAI class.

Compile Your AI

Compiling your program is easy as executing the command make from the shell’s root directory (the directory with the makefile in it) for the Java and C++ shells. For the Python shell, simply save the changes you made to your StudentAI file (Shift +zz if you’re editing using vim).

Test Your AI

To run and test your AI, see page 8. If you are using the Python Shell make sure you are using Python 3.5.2. On openlab, run the command module load python/3.5.2 to load Python 3.5.2.

Submit Your Project

At this point you should have your most up-to-date source code in the ‘src’ folder. Navigate out to the “Tools” folder, where you should find a script called submission.py. Please use the command python3 submission.py to make your zip file, and submit the zip file in Canvas.

Write Your Project Report (end of quarter)

After you’ve completed your Final AI at the end of the quarter, write a report according to the template file provided on Gitlab. Template is also shown on the last page of this student manual. The report is due one day after the Final AI. Make sure to turn in your report in pdf format.

 

5. Understanding the Tournament

After you have submitted your Final AI, you will be entered into a tournament with your classmates. (Late submissions are not valid for the tournament.) Every agent is run on

 

the same board to ensure fairness; your agent will be timed-out if it hangs for longer than 2 hours. Tournament results will determine how many extra credit points you get for writing a better AI than your classmates. Results/rankings will be posted to the class.

 

5.   Grading Policy

1st Deadline for Draft AI

Your AI should beat Random AI (6 times) 40% for successful submission, 10% per test

2nd Deadline for Minimal AI

 Your AI should beat Poor AI (6 times) 40% for successful submission, 10% per test

 

3rd Deadline for Final AI

 

Your AI should beat Average AI (6 times ) 28% for successful submission, 12% per test

 

6.   Shell Manual

Board Class:

Summary

 

This part describes the structure of Board class under Board.cpp/Board.java/BoardClasses.py

You can import/include this class into your AI file to use this class.

If you want to write your own board class, please make sure to include all code into your StudentAI.py/.cpp/.java. Multiple files for your AI IS NOT ALLOWED.(For C++ coders, you can have .cpp file and .h file both.)

Variables (in the init function)

 col: The number of columns. row: The number of rows.

p: Number of rows filled with Checker pieces at the start.

Functions

 

show_board: Prints out the current board to the console

 

get_all_possible_moves: Returns all moves possible in the current state of the board

is_win: Check if there is a winner. Return which player wins.

 

Move Class:

Summary

 This part describes the structure of Move class under Move.cpp/Move.java/Move.py This class already imported to your StudentAI.

Your AI must return a ‘Move’ object to describe the move Do not change this file

Variables (in the init function) l: list describing the move Functions

from_str: Makes a move object from a str describing the move.

Checker Class:

Summary

 This part describes the structure of Checker class under Checker.cpp/Checker.java/Checker.py

You can import/include this class into your AI file to use this class.

Variables (in the init function)

 color: color of the checker piece.

location: a tuple describing the location of the checker piece

Functions

 get_color: Returns the color of this piece.

get_location: Returns the location of this piece.

get_possible_moves: Returns all moves possible for this checker piece in the current state of the board

Running your AI:

Manual Mode

 

After you compile your AI, use the following commands to run your AI in manual mode:

 

Python:

python3 main.py {col} {row} {p} m {start_player (0 or 1)}

  C++:

./main {col} {row} {p} m {start_player (0 or 1)}

 

 Java:

java -jar Main.jar {col} {row} {p} m {start_player (0 or 1)}

 Play Against Other AI’s

The shell also supports playing against other local AI shells written in different programming languages or against other AI’s over the open network. To play across the network, connect through the school VPN (make sure you’re using school wifi).

Navigate to Tools/AI_Runner.py shell and run the following commands:

 

Local:

python3 AI_Runner.py {col} {row} {p} l {AI_1_path} {AI_2_path}

  

Network:

python3 AI_Runner.py n {AI_path}

 

 Note: {AI_path} indicates:

  1. py for Python

  2. main (executable) for c++

  3. jar for java

In other words, provide the path to your “main” file as the {AI_path)

Attachments:
(5/5)

Related Questions

CSI 1420 Introduction to C Programming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Assignment To Be Done By Our ExpertsGet A+ Grade Solution Guaranteed

expert
joyComputer science
(4/5)
12 Answers Hire Me
expert
Robert DLaw
(4.8/5)
790 Answers Hire Me
expert
Dr Samuel BarberaStatistics
(5/5)
529 Answers Hire Me
expert
Tutor For YouEconomics
(5/5)
735 Answers Hire Me