Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francois Hamonic
landscape_opt_networks_submission
Commits
2f90497e
Commit
2f90497e
authored
Sep 16, 2022
by
Francois Hamonic
Browse files
time sclaing
parent
18d49d6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
exec/marseille_execution_time_scaling.cpp
View file @
2f90497e
...
...
@@ -10,10 +10,10 @@
int
main
()
{
std
::
ofstream
data_log
(
"output/marseille_execution_time_scaling.csv"
);
data_log
<<
std
::
fixed
<<
std
::
setprecision
(
6
);
data_log
<<
"wastelands
"
<<
"local_inc
"
<<
"greedy_dec
"
<<
"
MIP
"
<<
std
::
endl
;
data_log
<<
"wastelands
,
"
<<
"local_inc
,
"
<<
"greedy_dec
,
"
<<
"
mip
"
<<
std
::
endl
;
std
::
vector
<
int
>
nbs_wastelands
;
for
(
int
i
=
10
;
i
<=
200
;
i
+=
10
)
nbs_wastelands
.
push_back
(
i
);
...
...
marseille_execution_time_scaling.pdf
0 → 100644
View file @
2f90497e
File added
plot_scripts/marseille_execution_time_scaling.py
0 → 100755
View file @
2f90497e
import
matplotlib.pyplot
as
plt
import
csv
import
numpy
as
np
import
statistics
def
readCSV
(
file_name
,
delimiter
=
','
):
file
=
csv
.
DictReader
(
open
(
file_name
),
delimiter
=
delimiter
)
return
list
([
row
for
row
in
file
])
rows
=
readCSV
(
'output/marseille_execution_time_scaling_tmp.csv'
)
x_datas
=
[
int
(
float
(
row
[
"wastelands"
]))
for
row
in
rows
]
def
get_datas
(
name
,
linstyle
,
maker_size
,
t
):
return
((
name
,
(
linstyle
,
maker_size
)),
(
x_datas
,
np
.
array
([
float
(
row
[
t
])
/
1000
for
row
in
rows
])
))
datas
=
[
get_datas
(
"local incremental"
,
"s-"
,
6
,
"local_inc"
),
get_datas
(
"greedy decremental"
,
"o-"
,
6
,
"greedy_dec"
),
get_datas
(
"MIP"
,
"P-"
,
6
,
"mip"
)
]
fig_size
=
plt
.
rcParams
[
"figure.figsize"
]
fig_size
[
0
]
=
10
fig_size
[
1
]
=
5
plt
.
rcParams
[
"figure.figsize"
]
=
fig_size
# plt.subplots_adjust(left=0.100, right=0.95, top=0.92, bottom=0.150)
plt
.
rcParams
.
update
({
'font.size'
:
16
})
xmin
=
min
(
x_datas
)
xmax
=
max
(
x_datas
)
plt
.
xlim
(
xmin
,
xmax
)
ymin
=
0
ymax
=
max
([
float
(
row
[
"mip"
])
/
1000
for
row
in
rows
])
yrange
=
ymax
-
ymin
y_border_percent
=
7.5
y_bottom
=
ymin
-
y_border_percent
*
yrange
/
100
y_top
=
ymax
+
y_border_percent
*
yrange
/
100
plt
.
ylim
(
y_bottom
,
y_top
)
# plt.title("quebec-{}-{}-ECA value vs available budget.pdf".format(orig, median))
plt
.
ylabel
(
'computation time in seconds'
,
rotation
=
90
,
fontweight
=
'bold'
)
plt
.
xlabel
(
"number of unbuilt lots"
,
fontweight
=
'bold'
)
for
((
label
,(
linestyle
,
marker_size
)),(
xdatas
,
ydatas
))
in
datas
:
plt
.
plot
(
xdatas
,
ydatas
,
linestyle
,
markersize
=
marker_size
,
label
=
label
)
legend
=
plt
.
legend
(
loc
=
'upper left'
,
shadow
=
True
,
fontsize
=
'medium'
)
plt
.
tight_layout
()
plt
.
show
()
plt
.
savefig
(
"output/marseille_execution_time_scaling_tmp.pdf"
,
dpi
=
500
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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