Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
proba-mc2020
proba-mc2020
Commits
e9468cfa
Commit
e9468cfa
authored
Jan 19, 2020
by
Matthieu Boileau
Browse files
Add log curve
parent
a7c7add9
Changes
1
Hide whitespace changes
Inline
Side-by-side
srw.py
View file @
e9468cfa
...
...
@@ -258,6 +258,8 @@ class BackToStart(NWalk):
fig
,
ax
=
self
.
_init_figure
(
ylabel
=
'Number of times'
)
ax
.
plot
(
self
.
nsteps
,
np
.
log
(
self
.
nsteps
)
*
3
/
10
,
label
=
r
'$\frac{10}{3}\log(n)$'
)
ax
.
plot
(
self
.
nsteps
,
ntimes
,
'o'
,
label
=
f
'Average over
{
self
.
nwalk
}
samples'
)
ax
.
legend
()
...
...
@@ -326,11 +328,11 @@ def empirical_winrate_A(a, b, p, n):
if
__name__
==
'__main__'
:
walk
=
Walk2D
(
100
)
anim
=
walk
.
generate_animation
()
walk
.
plot
()
#
walk = Walk2D(100)
#
anim = walk.generate_animation()
#
walk.plot()
FinalDistance
(
nwalk
=
1000
).
plot
()
MaxDistance
(
nwalk
=
1000
).
plot
()
BackToStart
(
nwalk
=
10000
,
nstepmax
=
5
000
).
plot
()
#
FinalDistance(nwalk=1000).plot()
#
MaxDistance(nwalk=1000).plot()
BackToStart
(
nwalk
=
10000
,
nstepmax
=
10
000
).
plot
()
plt
.
show
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment