CSCI 561 Foundations of Artificial Intelligence Assignment

Assignment Help Other Subject
Reference no: EM132388731

CSCI 561 Foundations of Artificial Intelligence Assignment - Fall 2019 - University of Southern California, USA

Guidelines -

This is a programming assignment. You will be provided sample inputs and outputs (attached). Please understand that the goal of the samples is to check that you can correctly parse the problem definitions and generate a correctly formatted output. The samples are very simple and it should not be assumed that if your program works on the samples it will work on all test cases. There will be more complex test cases and it is your task to make sure that your program will work correctly on any valid input. You are encouraged to try your own test cases to check how your program would behave in some complex special case that you might think of. Since each homework is checked via an automated A.I. script, your output should match the specified format exactly. Failure to do so will most certainly cost some points. The output format is simple and examples are provided. You should upload and test your code on vocareum.com, and you will submit it there. You may use any of the programming languages.

Project description -

In this project, we will play the game of Halma, an adversarial game with some similarities to checkers. The game uses a 16x16 checkered gameboard. Each player starts with 19 game pieces clustered in diagonally opposite corners of the board. To win the game, a player needs to transfer all of their pieces from their starting corner to the opposite corner, into the positions that were initially occupied by the opponent. Note that this original rule of the game is subject to spoiling, as a player may choose to not move some pieces at all, thereby preventing the opponent from occupying those locations. Note that the spoiling player cannot win either (because some pieces remain in their original corner and thus cannot be used to occupy all positions in the opposite corner). Here, to prevent spoiling, we modify the goal of the game to be to occupy all of the opponent's starting positions which the opponent is not still occupying.

Setup for two players:

Note: we only consider the two-player variant here; this game can also be played by four players but we will not explore this here.

  • Simple wooden pawn-style playing pieces, often called "Halma pawns."
  • The board consists of a grid of 16×16 squares.
  • Each player's camp consists of a cluster of adjacent squares in one corner of the board. These camps are delineated on the board.
  • For two-player games, each player's camp is a cluster of 19 squares. The camps are in opposite corners.
  • Each player has a set of pieces in a distinct color, of the same number as squares in each camp.
  • The game starts with each player's camp filled by pieces of their own color.

The initial setup is shown below for black and white players. We will always use this exact initial setup in this homework.

Play sequence:

We first describe the typical play for humans. We will then describe some minor modifications for how we will play this game with artificial agents.

Create the initial board setup according to the above description.

Players randomly determine who will move first.

Pieces can move in eight possible directions (orthogonally and diagonally).

Each player's turn consists of moving a single piece of one's own color in one of the following plays:

- One move to an empty square:

  • Move the piece to an empty square that is adjacent to the piece's original position (with 8-adjacency).
  • This move ends the play for this player's turn.

- One or more jumps over adjacent pieces:

  • An adjacent piece of any color can be jumped if there is an empty square on the directly opposite side of that piece.
  • Place the piece in the empty square on the opposite side of the jumped piece.
  • The piece that was jumped over is unaffected and remains on the board.
  • After any jump, one may make further jumps using the same piece, or end the play for this turn.
  • In a sequence of jumps, a piece may jump several times over the same other piece.

Once a piece has reached the opposing camp, a play cannot result in that piece leaving the camp.

If the current play results in having every square of the opposing camp that is not already occupied by the opponent to be occupied by one's own pieces, the acting player wins. Otherwise, play proceeds to the other player.

Below we show examples of valid moves (in green) and invalid moves (in red). At left, the isolated white piece can move to any of its empty 8 neighbors. At right, the central white piece can jump over one adjacent piece if there is an empty cell on the other side. After one jump is executed, possibly several other valid jumps can follow with the same piece and be combined in one move; this is shown in the sequence of jumps that start with a down-right jump for the central piece. Note that additional valid moves exist that are not shown (e.g., the central white piece could move to some adjacent empty location).

Note the invalid moves: red arrow going left: cannot jump over one or more empty spaces plus one or more pieces. Red arrow going left-down: cannot jump over one or more pieces plus one or more empty spaces. Red arrow going down: cannot jump over more than one piece.

Playing with agents:

In this homework, your agent will play against another agent, either created by the TAs, or created by another student in the class. For grading, we will use two scenarios:

1) Single move: your agent will be given in input.txt a board configuration, a color to play, and some number of seconds of allowed time to play one move. Your agent should return in output.txt the chosen move(s), before the given play time has expired. Play time is measured as total CPU time used by your agent on all CPU threads it may spawn (so, parallelizing your agent will not get you any free time). Your agent will play 10 single moves, each worth one point. If your agent returns an illegal move, a badly formatted output.txt, or does not return before its time is up, it will lose the point for that move.

2) Play against reference agent: your agent will then play 9 full games against a simple minimax agent with no alpha-beta pruning, created by the TAs. There will be a limited total amount of play time available to your agent for the whole game (e.g., 100 seconds), so you should think about how to best use it throughout the game. This total amount of time will vary from game to game. Your agent must play correctly (no illegal moves, etc) and beat the reference minimax agent to receive 10 points per game. Your agent will be given the first move on 5 of the 9 games. In case of a draw, the agent with more remaining play time wins.

Note that we make a difference between single moves and playing full games because in single moves it is advisable to use all remaining play time for that move. While playing games, however, you should think about how to divide your remaining play time across possibly many moves throughout the game.

In addition to grading, we will run a competition where your agent plays against agents created by the other students in the class. This will not affect grade. But the top agents will be referred to a contact at Google for an informal introduction. There will also be a prize for the grand winner.

Agent vs agent games:

Playing against another agent will be organized as follows (both when your agent plays against the reference minimax agent, or against another student's agent):

A master game playing agent will be implemented by the grading team. This agent will:

Create the initial board setup according to the above description.

Randomly assign a player color (black or white) to your agent.

When playing against the reference minimax, you will get the opening move. Otherwise who plays first will be chosen randomly.

Then, in sequence, until the game is over:

  • The master game playing agent will create an input.txt file which lets your agent know the current board configuration, which color your agent should play, and how much total play time your agent has left. More details on the exact format of input.txt are given below.
  • We will then run your agent. Your agent should read input.txt in the current directory, decide on a move, and create an output.txt file that describes the move (details below). Your time will be measured (total CPU time). If your agent does not return before your time is over, it will be killed and it loses the game.
  • Your playing time remaining will be updated by subtracting the time taken by your agent on this move. If time left reaches zero or negative, your agent loses the game.
  • The validity of your move will be checked. If the format of output.txt is incorrect or your move is invalid according to the rules of the game, your agent loses the game.
  • Your move will be executed by the master game playing agent. This will update the game board to a new configuration.
  • The master game playing agent will check for a game-over condition. If so, the winning agent will be declared the winner of this game.
  • The master game playing agent will then present the updated board to the opponent agent and let that agent make one move (with same rules as just described for your agent; the only difference is that the opponent plays the other color and has its own time counter).

Attachment:- Artificial Intelligence Assignment File.rar

Reference no: EM132388731

Questions Cloud

How competency modeling is similar from job analysis : Explain how competency modeling is similar and different from job analysis. Provide your own example that illustrates the similarities and differences.
About errors that can occur in the process of meiosis : About errors that can occur in the process of meiosis, and several types of errors are mentioned.
Programs and answer the questions : IMF, WTO, World Bank, UN and other NGOs we need to choose 3 of these programs and answer the following questions.
What could be two possible principles of universal grammar : Give a detailed definition of Universal Grammar. Explain what could be two possible principles of Universal Grammar. Give three types of evidence or arguments.
CSCI 561 Foundations of Artificial Intelligence Assignment : CSCI 561 Foundations of Artificial Intelligence Assignment - Fall 2019, Homework Help - University of Southern California, USA
How you would proceed if working with the client : Select a scenario below and discuss how you would proceed if working with this client. Do not copy and paste, or repeat the scenario in your paper.
Preparing orientation on culture and the workplace : A nurse educator is preparing an orientation on culture and the workplace. What are influences of their value systems on childbearing and bereavement practices
Examine former ceo mark dwight leadership style : The video case "Timbuk2: Former CEO Sets a Course" examines former CEO Mark Dwight's leadership style. Would you consider him a charismatic or transformational.
Define energy related to work and heat and matter : Define energy related to work and heat and matter. Discuss the central role of ATP in the overall energy metabolism of the cell.

Reviews

Write a Review

Other Subject Questions & Answers

  The quantificational notation

Paraphrase the following using the quantificational notation:

  Write a brief description of the illness

The illness, as well as a lack of normalcy in the patient's life, may hinder biological, psychological, and social development.

  Question 1tourism by its very personality is considered to

question 1tourism by its very personality is considered to be a fragmented business where its development and

  What evidence convinced most scientists to accept the theory

What evidence convinced most scientists to accept the theory of plate tectonics? What causes the 'Ring of Fire,' which borders much of the Pacific Ocean? What is the force that moves continents and tectonic plates?

  Issues regarding effective listening

Your workplace has recently experienced issues regarding effective listening. Some employees are not "hearing" what is being communicated

  Explain what primarily distinguishes renaissance art

Briefly explain what primarily distinguishes Renaissance art in general from the prior Medieval period. Then, trace the evolution and development of art through

  Discuss gaps between the science of psychology

Discuss gaps between the science of psychology and the popular media's portrayal of psychology. Are there ways to close the gap?

  What strategy you chose would be the most effective

Discuss your opinions with regards to the type of competitive strategy you would prefer if you were running a company, and wanted to establish a long term competitive edge over your competitors.

  Idea for innovation along with model

Will submit their own idea for an innovation along with a model they find useful for evaluating its merits. Each member is responsible for completing research

  Write essay about level of social services provided in texas

Write a 2 page essay about the level of social services provided in Texas. Explain the TANF and SNAP programs. Discuss the tradeoff between the higher taxes that would be required.

  Define ethical decision making and social responsibility

"Environmental Awareness and Organizational Sustainability" Please respond to the following: Use the Internet to research one (1) environmentally aware.

  Examine the concept of socialization

Earlier in this course, we learned about socialization and how the way we are raised can affect what we think about ourselves and other people.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd