Commit df17e5c5 authored by Grégoire GRZECZKOWICZ's avatar Grégoire GRZECZKOWICZ
Browse files

Stop ploting option

parent 3e398962
......@@ -48,6 +48,9 @@ if __name__=="__main__":
can.add_argument("-a", "--variation-scale", metavar="RATIO", default=0.3, type=float,
help="Scale of the variation operators (as a ration of the domain width)")
can.add_argument("-no", "--no-graphical-output", action='store_true', default=False,
help="Disable graphical output")
can.add_argument("-o", "--output-file", metavar="NAME", default=None, type=str,
help="Output file where log are put")
......@@ -165,26 +168,28 @@ if __name__=="__main__":
# Fancy output.
print("\n{} : {}".format(val,sensors))
shape=(the.domain_width, the.domain_width)
if the.no_graphical_output is False:
shape=(the.domain_width, the.domain_width)
fig = plt.figure()
fig = plt.figure()
if the.nb_sensors ==1 and the.domain_width <= 50:
ax1 = fig.add_subplot(121, projection='3d')
ax2 = fig.add_subplot(122)
if the.nb_sensors ==1 and the.domain_width <= 50:
ax1 = fig.add_subplot(121, projection='3d')
ax2 = fig.add_subplot(122)
f = make.func(num.cover_sum,
domain_width = the.domain_width,
sensor_range = the.sensor_range * the.domain_width)
plot.surface(ax1, shape, f)
plot.path(ax1, shape, history)
else:
ax2=fig.add_subplot(111)
f = make.func(num.cover_sum,
domain_width = the.domain_width,
sensor_range = the.sensor_range * the.domain_width)
plot.surface(ax1, shape, f)
plot.path(ax1, shape, history)
else:
ax2=fig.add_subplot(111)
domain = np.zeros(shape)
domain = pb.coverage(domain, sensors,
the.sensor_range * the.domain_width)
domain = plot.highlight_sensors(domain, sensors)
ax2.imshow(domain)
domain = np.zeros(shape)
domain = pb.coverage(domain, sensors,
the.sensor_range * the.domain_width)
domain = plot.highlight_sensors(domain, sensors)
ax2.imshow(domain)
plt.show()
plt.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment