In this game we have a number of players interacting in a

Assignment Help JAVA Programming
Reference no: EM13346384

In this game, we have a number of players interacting in a simple way. The game takes place on a (virtual), two-dimensional piece of land. There are two types of player: Sheep, and Wolves. Sheep start at one point of the land, and they have to get to get to a green pasture to win. They move one step at a time. Usually, there are several sheep that start out at the same time. The more sheep get to the destination, the better. This diagram shows five sheep ("s") and the green pasture at the top:

758_Wolves and Sheep.png

Unfortunately, there is also a wolf. The wolf's objective is to find (and eat) as many sheep as possible. The wolf may be a little faster than the sheep, but it always needs a number of steps to finish eating one.Sheep and wolves are realized as separate Java classes. Each student will submit either a Sheep or a Wolf class. We're going to play a tournament: we're going to have an instance of each wolf and instances of four or five different sheep play the game and tally up the results.

Beware... the rules of the game are simple, but its dynamics can be very complex.

Example: Suppose we have 30 students (numbered 0..29) in this class. We will form 7 teams (A,B,C,D,E,F,G). Teams A,B,C,D will write the sheep - this means we'll have about 16 Sheep classes coming in. Teams E,F,G will write wolves - which makes another 14 Wolf classes.

In the tournament, we'll run many thousand games, each with one combination of the sheep classes from one of the four sheep teams, and exactly one wolf (out of 14) - that's 56 combinations. We need three rules of engagement to make this work.

Rule 1: You may not collaborate with other students outside of the team.

Rule 2: You should collaborate with the other students within your team. While everyone has to do their own implementation, you, for
example may collude to plot joint strategies against the wolf (if you're programming a sheep agent).

Rule 3: You must submit only your own code and may not write code for others. Small, shared functions that are marked as such are OK.

The playing field is a m by n rectangular grid with m*n cells. In each game, there are a number of players (several sheep players, and one wolf). Each player occupies exactly one cell in the grid, and no cell will contain more than one player (except a combination of the wolf and a sheep). Cells may also contain an obstacle, in which case no player can occupy the cell.

Players start at an assigned location. There are multiple steps (iterations): In each iteration, each sheep may move exactly one step to the left, the right, up, down, or diagonally, but not beyond the boundaries of the grid. In each iteration, the wolf may also move a constant k steps (k is to be determined by the game, and fixed throughout the tournament. All players will be told k). All players make one move at a time and see the updated positions. The wolf moves last. The player instance determines a move and communicates it as Δx and Δy (steps in each direction), where Δx and Δy are signed integers. For sheep, (Δx2 + Δy2) <= 2.0. For the wolf, (Δx2 + Δy2) < k2. For instance, if the wolf decides to move 2 steps to the left (Δx=-2) and 3 steps up (Δy=-3), then that would be a legal move if k is at least 2.9, because:

996_Wolves and Sheep1.png

If more than one sheep try to occupy the same cell, one of the sheep's moves fails and the sheep will not move. If the wolf and a sheep attempt to occupy the same location, the wolf begins to eat the sheep. A meal takes a number of steps f, during which the wolf will not move. The sheep perishes. Several green pastures ("goal cells") are determined by the game. Their location is known to all players. If a sheep reaches one these pastures, the sheep wins its game and disappears. The wolf cannot enter a pasture. The game terminates when all sheep have reached pastures or have been eaten, or after m+n steps, whichever comes first.

Parameters: The game parameters are available to the players upon instantiation:

1817_Wolves and Sheep2.png

Reference no: EM13346384

Questions Cloud

Write a paper on boyles law and describe compression and : write a paper on boyles law and describe compression and combustion stroke . also explain charless law and illustrate
Write a research report on software design and answer : write a research report on software design and answer diffrent type of questions related to design.1. describe three
Part 1for the first part of this assignment compare and : part 1for the first part of this assignment compare and contrast the theoretical and practical differences between
Write a paper on orthogonal frequency-division multiplexing : write a paper on orthogonal frequency-division multiplexing with advantages disadvantages and uses.the format
In this game we have a number of players interacting in a : in this game we have a number of players interacting in a simple way. the game takes place on a virtual
There are two questions on financial planningq why do you : there are two questions on financial planning.q why do you think most long term financial planning begins with the
Suppose a ferris wheel with radius of 12 meters is rotating : suppose a ferris wheel with radius of 12 meters is rotating at a rate of 2 rotations per minute.a. how fast is a person
Write a paper about what normal operations of the system : write a paper about what normal operations of the system that has gone wrong with obesity. then the effects of obesity
Exercise prepare a flexible budget gator divers is a : exercise prepare a flexible budget gator divers is a company that provides diving services such as underwater ship

Reviews

Write a Review

JAVA Programming Questions & Answers

  Method summarizesequences that takes a string as a parameter

Now implement the method summarizeSequences that takes a String as a parameter. This method should open the file named by this String, and read a sequence from that file into an array list using the getSequence method you wrote above

  Write a program called drawing in the form of a public class

Write a program called Drawing in the form of a public class Drawing that extends a Java JFrame and provides the following features.

  Write a functions that takes an array of doubles

1. Write a function that is passed a single integer and then calculates the factorial of that number. A factorial is the product of the integer times all of the integers below it stopping at 1. So n!= n*(n-1)*(n-2).......3.2.1

  Implement a thread for each creature representing a task

Implement a threads and a GUI interface using advanced Java Swing classes.

  Create dict letter frequencies that reads the file

createDictLetterFrequencies that reads the file and also takes a parameter n. This method should return a dictionary of dictionaries. The outer dictionary associates the previous n letters of a word with an inner dictionary, which indicates the frequ..

  Organization structure change over time

How and why did the organization structure change over time, and in what ways were some of these changes responsible for some of their recent problems?

  Program that initializes an array with ten random integers

Write a JAVA program that initializes an array with ten random integers and then prints four lines of output, containing

  Implement the finite field gf

Write a program called "GF2.java" to implement the finite field GF(p n )where p is a prime number andn is a positive integer.You also need to write four methodsto realize.

  Describe different professional levels in this discipline

What is Anesthesiology and critical care medicine describe the specific discipline, what is their focus (i.e., emergency medicine, education and prevention, psychiatric treatment etc.) Describe the different professional levels in this discipline

  The user is assumed to enter the list in sorted order

Make sure you FULLY test your program! Make sure to run your program multiple times, inputting combinations of values that will test all possible conditions for your IF statements and loops. Also be sure to test border-line cases.

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Create a recursive factorial program

Assignment 1: Create a recursive factorial program that prompts the user for an integer  N  and writes out a series of equations representing the calculation of  N !. For example, if the input is 4, the output could be:

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