CS计算机代考程序代写 dw = DrunkardsWalkSim(walls = 10) # :steps is the default measure

dw = DrunkardsWalkSim(walls = 10) # :steps is the default measure

runsim(dw, verbose = true)
runsim(dw)

results = repeat(dw, NormalStats, 1000)
mean(results)
confint(results)

dw = DrunkardsWalkSim(walls = 10, measure = :leftWall)

results = repeat(dw, BinomialStats, 1000)
mean(results)
confint(results)

dw = DrunkardsWalkSim(walls = 10, measure = :steps)

results = repeat(dw, NormalStats, 1000)
mean(results)
confint(results)

# note: the internal code that allows the ‘measure’ keyword to function in the constructor is advanced Julia
# you do not need to replicate this for the assignment – just define mesaure(::Simulation, ::State) directly