Docsity

Genetic Algorithm and Fuzzy Logic Labs, Lab Reports of Computer Science

Toggle sidebar
bg1
GeneticAlgorithmLab
Inordertodothislab,youandyourgroupshouldhavecompiled,debugged,andtestedthefollowing
classes
1. Organism
2. Population
3. OrganismTest1(atestclass)
RecallalsothatwewilladjustthecompareTomethodoftheOrganismclasssothatsmallvaluessort
firstforminimizationproblemsandlargevaluessortfirstformaximizationproblems.
Problem1
Findthemaximumvalueofz=x+yifwerequirethatx<=10andy<=10.Youshouldbeabletoeasilysolve
thisprobleminyourhead!
Maximumvalue:______________________
Valueofxatmaximum____________________
Valueofyatmaximum_____________________
Problem2
Findthemaximumvalueofexp(‐(x‐4)2‐(y‐5)2)
Maximumvalue:______________________
Valueofxatmaximum____________________
Valueofyatmaximum_____________________
Problem3:
Findtheminimumvalueof1.0/(1+exp(‐x2‐y2)).
Minimumvalue:______________________
Valueofxatminimum____________________
Valueofyatminimum_____________________
Problem4
Acompanymakestwoproducts,sayAandB.TheprofitoneachunitofAis$3andtheprofitoneach
unitofBis$5.EachunitofZmustundergosandingforonehour.Fourhoursareavailableperdayfor
sanding.EachunitofBmustundergoaseparateone‐hoursandingprocess.Thereare6hoursperday
forthesecondprocess.Ittakes3hourstopaintaunitofAandittakes2hourstopaintaunitofB.
pf3

Partial preview of the text

Download Genetic Algorithm and Fuzzy Logic Labs and more Lab Reports Computer Science in PDF only on Docsity!

Genetic Algorithm Lab

In order to do this lab, you and your group should have compiled, debugged, and tested the following classes

  1. Organism
  2. Population
  3. OrganismTest1 (a test class) Recall also that we will adjust the compareTo method of the Organism class so that small values sort first for minimization problems and large values sort first for maximization problems.

Problem 1

Find the maximum value of z=x+y if we require that x<=10 and y<=10. You should be able to easily solve this problem in your head! Maximum value: ______________________ Value of x at maximum ____________________ Value of y at maximum_____________________

Problem 2

Find the maximum value of exp(‐(x‐4)^2 ‐ (y‐5)^2 ) Maximum value: ______________________ Value of x at maximum ____________________ Value of y at maximum_____________________

Problem 3:

Find the minimum value of 1.0/(1+exp(‐x^2 ‐y 2 )). Minimum value: ______________________ Value of x at minimum____________________ Value of y at minimum_____________________

Problem 4

A company makes two products, say A and B. The profit on each unit of A is $3 and the profit on each unit of B is $5. Each unit of Z must undergo sanding for one hour. Four hours are available per day for sanding. Each unit of B must undergo a separate one‐hour sanding process. There are 6 hours per day for the second process. It takes 3 hours to paint a unit of A and it takes 2 hours to paint a unit of B.

There are 18 hours a day available for painting. How many units of each product should the company make in order to maximize the daily profit? Maximum profit: ______________________ Units of product A ____________________ Units of product A _____________________