Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python3 Host Class The host class is a person that a collection of bacteria in them. init method The init method will take an extra

Python3
image text in transcribed
image text in transcribed
image text in transcribed
Host Class The host class is a person that a collection of bacteria in them. init method The init method will take an extra argument that passes in the number of bacteria. The bacteria resistance will initialize to 3. Over time the host can have thousands of bacteria, so you'll want to use a data structure that can hold multiple instances str method The string method will return a string with 3 lines. The count of how many bacteria there are in the hose, the Average Health of the bacteria, and the Average resistance of the bacterial. >>>hHost (1) >>> print (h) Count 1 Average Health10.0 Average Resistance4.0 tick) Method The tick method has one additional parameter, which is with_dose and is a boolean. If it's true then the bacteria will be dosed. If it's false, then the cells won't be dosed. It will call the tick method for all of the bacteria, add any new bacteria from cells that reproduce and remove any cells that have died. The amount of dosage that is used is 25. >>>h Host (1) >>>print (h) Count:1 Average Health 10.0 Average Resistance 2.0 >>> h.tick ( >>>h.tick () >>>h.tick ) >>>print (h) Count: 2 Average Health 10.0 Average Resistance 2.0 >>>h.tick (True) >>> print (h) Count 0 Average Health nan Average Resistance nan Specifications The initial health of bacteria cells is 10 The life span of cells is 15 The birth counter of the cells is initially 3 . . When dosed the dosage used is 25 Sample Program There will be 3 hosts that we try. Each starts out with 1 bacteria and runs for 30 ticks, before they discover they have an infection They only vary on the next 15 ticks. The first is a host with no doses, so they really are run for 45 ticks and show the final result. The next is a host that is dosed for the last 15 ticks. This is a fully dosed example. The last is a partially dosed example and only only doses every other round on the last 15 trials. What we expect to see is that our strain in the hosts become more resistant No dosage Count21342 Average Health 10.0 Average Resistance 2.61859244681848 Full dosage Count 0 Average Health nan Average Resistance nan Half dosed Count 856 Average Health7.560439382139141 Average Resistance : 7.853971962616822

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Does the business have a sound marketing plan?

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago