Examlex

Solved

Case Study 3: 1. Def MainSimulation()

question 9

Multiple Choice

Case Study 3:
1. def mainSimulation() :
2. numberOfBears = 10
3. numberOfFish = 10
4. worldLifeTime = 2500
5. worldWidth = 50
6. worldHeight = 25
7.
8. myWorld = World(worldWidth, worldHeight)
9. myWorld.draw()
10.
11. for i in range(numberOfFish) :
12. newFish = Fish()
13. x = random.randrange(myWorld.getMaxX() )
14. y = random.randrange(myWorld.getMaxY() )
15. while not myworld.emptyLocation(x, y) :
16. x = random.randrange(myWorld.getMaxX() )
17. y = random.randrange(myWorld.getMaxY() )
18. myWorld.addThing(newFish, x, y)
19.
20. for i in range(numberOfBears) :
21. newBear = Bear()
22. x = random.randrange(myWorld.getMaxX() )
23. y = random.randrange(myWorld.getMaxY() )
24. while not myWorld.emptyLocation(x, y) :
25. x = random.randrange(myWorld.getMaxX() )
26. y = random.randrange(myWorld.getMaxY() )
27. myWorld.addThing(newBear, x, y)
28.
29. for i in range(worldLifeTime) :
30. myWorld.liveALittle()
31.
32. myWorld.freezeWorld()
-Refer to the session in the accompanying Case Study 3. On what lines does most of the simulation work take place?


Definitions:

Netstat

A command that can view current network connections and the local routing table for a PC.

Ports

Physical docking points on a computer or networking device used for connecting cables and peripherals.

Intermittent

Occurring at irregular intervals; not continuous or steady, often used to describe problems or behaviors in electronic devices that happen sporadically.

Connectivity

The ability of devices to connect with other devices or networks to share data and resources.

Related Questions