Write a program using a genetic algorithm

Assignment Help JAVA Programming
Reference no: EM132375314

Assignment One

Write a program using a Genetic Algorithm to solve the delivery problem below:

The Delivery Problem:

A Delivery company has a set of boxes to deliver. Each box has a value and a weight. It has one delivery vehicle. You are given a capacity c, which is the maximum total weight that can be transported and a quota q, which is the minimum total value v that you want to carry at any one time. The problem is to find a subset of the objects whose total weight w is at most equal to the capacity (w ≤ c) and whose total value is at least equal to the quota v ≥ q.

For example, given these three objects:

Object

Weight

Value

A

70

80

B

50

50

C

50

50

and a capacity of 110 and a quota of 90, then a solution to the problem is the set {B, C}. Note that there is no solution involving object A, because once you have loaded A, you cannot load any of the other two. (You are not allowed to choose a fraction of an object.)

The program should take its input from an input file that will contain a number of problems in sequence. Each problem has the following format.
• First line: ***
• Second line: Capacity.
• Third line: Quota.
• Fourth line: Number of objects
• Remaining lines: 1 line per object. Name, weight, and value, separated by blanks. There can be any number of blank lines separating problems.You may assume that:
• There are at most 20 objects.
• A name is a single alphabetical character.
• All quotas, capacities, weights, and values are integers.

An input file containing one example will have the following form:

*** 100
400
9
A   70  260
B  60  245
C  50  200
D  40  100
E  30  80
F  20  65
G  10  60
H  10  60
I  1  10
Your programs should output the solution set, the total weight and the total value. Also output the generation in which the solution was found.

Specifications

1. Design and implement the program (using a genetic algorithm) as specified above.

2. Sample input is given in a text file (input.txt).

3. Write a report detailing the following:

(a) Describe a chromosome in the initial population and the population size used.

(b) Define the fitness function you used.

(c) Describe the selection method used.

(d) Describe the mutation operator and the mutation rate used.

(e) Describe the crossover operator and the crossover rate used.

(f) Describe the termination criterion.

Attachment:- Artificial Intelligence.rar

Reference no: EM132375314

Questions Cloud

How the modifications will prevent behavior problems : List five classroom modifications for students with special needs from the list on pages 167-168. Explain how these modifications will prevent behavior problems
What would be examples of valid selection methods : What would be examples of valid selection methods used by the human resource department to ensure selecting the appropriate candidate for a job.
Topic - Elliptic Curve Cryptography and Image Steganography : Topic - Elliptic Curve Cryptography and Image Steganography. Enhancing Medical Data Security via Combining Elliptic Curve Cryptography and Image Steganography
Cartesian dualism vs. identity theory : Use the Criteria of Adequacy to compare any two theories of mind (such as Cartesian Dualism vs. Identity Theory). Which do you think is the best theory?
Write a program using a genetic algorithm : COMP304 - Artificial Intelligence - University of KwaZulu-Natal, South Africa - Write a program using a Genetic Algorithm to solve the delivery problem.
What he wanted without any regard for personal property : My first thoughts on Gilgamesh were that he took what he wanted without any regard for personal property
Write sql command to create new table for player statistics : ITECH 2004 Data Modelling Individual Assignment – SQL, Federation University Australia. Write SQL command to create new table for player statistics
Manhood or masculinity are revealed in the narrative : In the preface to the Narrative of the Life of Frederick Douglass, What assumptions about manhood or masculinity are revealed in the Narrative?
How can we reconcile civil liberties and national security : Combating terrorism has entailed restrictions on civil liberties. How can we reconcile civil liberties and national security? What sorts of limits.

Reviews

len2375314

9/23/2019 11:56:21 PM

Submission • The assignment must be submitted on 13:00. • You must use the Course website to submit. Click on Assignments in the Activities block (top left). Then click on Assignment Two. You will be taken to a page which allows you to upload a file. You can re-upload a file but this will overwrite any file that was previously uploaded.

len2375314

9/23/2019 11:55:25 PM

Use either Java or C++ to implement the program. Submit both the source code and you must submit executable programs that runs without the IDE being installed on the user’s system. Java programs: Submit a jar ?le or the class ?les that will run. Ensure that the jar/class ?les can be run on a machine with only the JDK installed (i.e. without the IDE that you have used to create the program). C++ programs: Ensure that you compile the program to run on machines that do not have C++. The interface can be text-based or graphical. Programs that do not run will be allocated a mark of zero.

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. 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!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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