Docsity

Homework 3 Answers - Object-Oriented Simulation/Discrete Event Models | ECE 575, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
HW3 Answers
Prey-predator DEVS
X = {}
S = {(prey,pred)|prey in Nat, pred in Nat} where Nat = 0,1,2,…
Y = Nat
deltaint(prey,pred) = (prey-pred,2*pred) if prey >= pred
= (0,pred+prey) if 0 < prey < pred
= (0,0) otherwise (i.e., prey = 0)
ta(prey,pred) = pred/(prey+1) if pred>0
= infinity otherwise
lambda(pred,prey) = pred+prey
Note: when there are fewer prey than predators, the prey are extinguished and
the predators that do this divide as usual, the others remain to the next transition
and they will die out in the transition after that. It is also possible to allow the
predators that don’t find prey to die out on this transition (so there will be 2*prey
instead of pred+prey). The English statement of the model is somewhat
ambiguous on this point. However, the choice of pred+prey is better because
then all predators live the same time rather than some dying early and some
much later (considering the time advance function).
Also note that the problem statement allowed the time advance to be zero for the
case of some prey with zero predators. Since this state transitions back to itself,
we have a cycle of states with zero time advance, and therefore an illegitimate
DEVS. To correct this situation, the time advance for any case of vanished
predators is set to infinity. In general, you must be aware of the possibility that
your model may have a non-diverging sum of time advances along a state
trajectory.
Below are some state and output trajectories drawn against time lines
pf2

Partial preview of the text

Download Homework 3 Answers - Object-Oriented Simulation/Discrete Event Models | ECE 575 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

HW3 Answers

Prey-predator DEVS

X = {}

S = {(prey,pred)|prey in Nat, pred in Nat} where Nat = 0,1,2,… Y = Nat

deltaint(prey,pred) = (prey-pred,2*pred) if prey >= pred

= (0,pred+prey) if 0 < prey < pred = (0,0) otherwise (i.e., prey = 0)

ta(prey,pred) = pred/(prey+1) if pred>

= infinity otherwise

lambda(pred,prey) = pred+prey

Note: when there are fewer prey than predators, the prey are extinguished and

the predators that do this divide as usual, the others remain to the next transition and they will die out in the transition after that. It is also possible to allow the predators that don’t find prey to die out on this transition (so there will be 2*prey instead of pred+prey). The English statement of the model is somewhat ambiguous on this point. However, the choice of pred+prey is better because

then all predators live the same time rather than some dying early and some much later (considering the time advance function).

Also note that the problem statement allowed the time advance to be zero for the case of some prey with zero predators. Since this state transitions back to itself,

we have a cycle of states with zero time advance, and therefore an illegitimate DEVS. To correct this situation, the time advance for any case of vanished predators is set to infinity. In general, you must be aware of the possibility that your model may have a non-diverging sum of time advances along a state trajectory.

Below are some state and output trajectories drawn against time lines

prey

pred

e

output

ta = 10/

ta = infinity

state

30

10

20

20 40

0

0

ta = 20/

ta = 40

40 40 40

prey

pred

e

output

ta = infinity

state