In java: Based on the concept of natural selection. They allow us to explore a search space by "evolving“ a set of solutions to a problem that score well against a fitness function. An example is particularly helpful in understanding this concept. We'll use the bin packing problem, which is a famous problem in computer science. Pretend that your town is being attacked by zombies, and you have to abandon your house and go on the run. (It's possible that this isn't *exactly* how the problem is elassically deseribed, but this version is way more interesting.) You are only able to carry 10 pounds of stuff with you in addition to food and other necessities, and you want to bring things that you can sell for the greatest amount of money possible. Below is a list of items you could take, along with their weight and selling price. Which items should you take with you in order to maximize the amount of money you can get? Item weight.worth Cell phone, 0.25, 600 Gaming laptop, 10, 2000 Jewelry, 0.5, 500 Kindle, 0.5, 300 Video game console, 3, 500 Small cuckoo clock, 5, 1500 Silver paperweight, 2, 400 It turns out that the best you can do in this situation is to take the cell phone, jewelry, Kindle, video game console, and small cuckoo clock. Together, these items weigh 9.25 pounds and are worth $3400. The tricky thing about the bin packing problem is that the only way you can be sure that you have the optimal set of items is to try all possible combinations. You might be tempted to try short cuts, like taking items in order of worth until you hit the weight limit (which in this case would mean taking just the gaming laptop, worth $2000) or taking the lightest items until you reach the weight limit (which in this case would be the cell phone, jewelry, Kindle, silver paperweight, and video game console, worth $2300). Neither of these strategies nets as much money as the optimal combination. Trying all possible combinations is a lot of work, and the zombies might get you while you're trying to work things out. The solution we end up with is not guaranteed to be the optimal one, but it is likely to at least be pretty good.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Crossover    and    Mutation    
The    two    main    operations    in    evolutionary    computing    are    crossover    and    mutation.    Crossover    
works    like    this:    
Randomly    choose    two    parents    from    the    population.    Let’s    say    these:    
Parent    1:        T        F        T        F        T        T        F    
Parent    2:        T        T        T        F        F        T        T    
Those    two    parents    will    create    a    child    whose    DNA    is    related    to    the    parents’.    It    works    like    
this:    for    each    of    the    seven    genes    in    the    chromosome,    we    will    randomly    pick    a    number    
between    1    and    10    and    use    it    to    choose    which    parents’    value    the    child    will    get.    If    the    random    
number    is    1    through    5,    we    will    use    Parent    1’s    included    value    for    the    child;    if    it    is    6    through    
10,    we’ll    use    Parent    2’s.    Let’s    assume    our    seven    random    numbers    are:    
1        4        10        3        6        6        9    
Then    the    child’s    set    of    item    included    =ields    would    be:    
Child:        T        F        T        F        F        T        T    
Mutation    is    even    simpler:    we    choose    a    single    individual    from    our    population    and    again    
generate    a    random    number    between    1    and    10    for    each    nucleotide.    Mutation    generally    
happens    more    rarely    than    reproduction,    so    if    the    random    number    is    1,    we    will    =lip    that    gene    
in    the    individual;    otherwise,    we    will    leave    it    the    same.    Let’s    assume    our    seven    random    
numbers    are:    
5        1        7        8        9        2        7    
and    the    chosen    individual’s    included    values    are:    
T        T        F        T        T        T        F    
Then    after    mutation,    that    individual    now    looks    like    this    (with    the    second    gene    =lipped    from    
a    T    to    a    F):    
T        F        F        T        T        T        F    

public class Chromosome extends ArrayList implements Comparable private static Random rng Used for random number generation public Chromosome() This no-arg constructor can be empty public Chromosome(ArrayList items) Adds a copy of each of the items passed in to this Chromosome. Uses a random number to decide whether each item’s included =ield is set to true or false. 

 

 

File
Home
Insert
Draw
Design
Layout
References
Mailings
Review
View
Help
RCM
Comments
A Share
E - E - E
Times New Roman
12
A A Aa v
Normal
No Spacing
Heading 1
Editing
Paste
в IU
ab X2
x A
A
Dictate
Sensitivity
Editor
Reuse
Files
Undo
Clipboard
Font
Paragraph
Styles
Voice
Sensitivity
Editor
Reuse Files
In java:
Based on the concept of natural selection. They allow
a set of solutions to a problem that score well against a fitness function. An example is
particularly helpful in understanding this concept. We'll use the bin packing problem, which is a
famous problem in computer science. Pretend that your town is being attacked by zombies, and
you have to abandon your house and go on the run. (It's possible that this isn't *exactly* how the
problem is classically described, but this version is way more interesting.) You are only able to
carry 10 pounds of stuff with you in addition to food and other necessities, and you want to bring
things that you can sell for the greatest amount of money possible. Below is a list of items you
could take, along with their weight and selling price. Which items should you take with you in
order to maximize the amount of money you can get?
to explore a search space by “evolving"
Item,weight,worth
Cell phone, 0.25, 600
Gaming laptop, 10, 2000
Jewelry, 0.5, 500
Kindle, 0.5, 300
Video game console, 3, 500
Small cuckoo clock, 5, 1500
Silver paperweight, 2, 400
It turns out that the best you can do in this situation is to take the cell phone, jewelry, Kindle,
video game console, and small cuckoo clock. Together, these items weigh 9.25 pounds and are
worth $3400. The tricky thing about the bin packing problem is that the only way you can be
sure that you have the optimal set of items is to try all possible combinations. You might be
tempted to try short cuts, like taking items in order of worth until you hit the weight limit (which
in this case would mean taking just the gaming laptop, worth $2000) or taking the lightest items
until
reach the weight limit (which in this case would be the cell phone, jewelry, Kindle,
you
silver paperweight, and video game console, worth $2300). Neither of these strategies nets as
much money as the optimal combination. Trying all possible combinations is a lot of work, and
the zombies might get you while you're trying to work things out. The solution we end up with is
not guaranteed to be the optimal one, but it is likely to at least be pretty good.
Tou
<> 1>
>
Transcribed Image Text:File Home Insert Draw Design Layout References Mailings Review View Help RCM Comments A Share E - E - E Times New Roman 12 A A Aa v Normal No Spacing Heading 1 Editing Paste в IU ab X2 x A A Dictate Sensitivity Editor Reuse Files Undo Clipboard Font Paragraph Styles Voice Sensitivity Editor Reuse Files In java: Based on the concept of natural selection. They allow a set of solutions to a problem that score well against a fitness function. An example is particularly helpful in understanding this concept. We'll use the bin packing problem, which is a famous problem in computer science. Pretend that your town is being attacked by zombies, and you have to abandon your house and go on the run. (It's possible that this isn't *exactly* how the problem is classically described, but this version is way more interesting.) You are only able to carry 10 pounds of stuff with you in addition to food and other necessities, and you want to bring things that you can sell for the greatest amount of money possible. Below is a list of items you could take, along with their weight and selling price. Which items should you take with you in order to maximize the amount of money you can get? to explore a search space by “evolving" Item,weight,worth Cell phone, 0.25, 600 Gaming laptop, 10, 2000 Jewelry, 0.5, 500 Kindle, 0.5, 300 Video game console, 3, 500 Small cuckoo clock, 5, 1500 Silver paperweight, 2, 400 It turns out that the best you can do in this situation is to take the cell phone, jewelry, Kindle, video game console, and small cuckoo clock. Together, these items weigh 9.25 pounds and are worth $3400. The tricky thing about the bin packing problem is that the only way you can be sure that you have the optimal set of items is to try all possible combinations. You might be tempted to try short cuts, like taking items in order of worth until you hit the weight limit (which in this case would mean taking just the gaming laptop, worth $2000) or taking the lightest items until reach the weight limit (which in this case would be the cell phone, jewelry, Kindle, you silver paperweight, and video game console, worth $2300). Neither of these strategies nets as much money as the optimal combination. Trying all possible combinations is a lot of work, and the zombies might get you while you're trying to work things out. The solution we end up with is not guaranteed to be the optimal one, but it is likely to at least be pretty good. Tou <> 1> >
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY