Beispiel #1
0
                  get_path(folder, "SNR_Base_Station-%s" % n),
                  title=net.name + "\nSNR levels (Base Station)",
                  format='png',
                  xlabel="Packet Number",
                  ylabel="SNR")

    #    plotter.plots(np.arange(len(snr_base[1:])), lqi_base[1:],
    #                  get_path(folder, "LQI_Base_Station-%s" % n),
    #                  title="LQI's", format='png',
    #                  xlabel="Packet Number", ylabel="LQI")

    plotter.plot_bars(np.arange(1, n + 1),
                      consume,
                      get_path(folder, "Energy Consumption-", prefix=n),
                      ymax=1.1 * max(consume),
                      ymin=0.9 * min(consume),
                      title=net.name + "\nEnergy Consumption (%s nodes)" % n,
                      xlabel="Nodes",
                      ylabel="mJ",
                      format='png')

    plotter.plot_bars(np.arange(1, n + 1),
                      loss,
                      get_path(folder, "Loss Packets-", prefix=n),
                      ymax=1.1 * max(loss),
                      ymin=0.9 * min(loss),
                      title=net.name + "\nLoss Packets (%s nodes)" % n,
                      xlabel="Nodes",
                      ylabel="No.",
                      format='png')
Beispiel #2
0
                  snr_base[1:],
                  get_path(DATETIME_DIR, "SNR_Base_Station-%s" % n),
                  title="SNR levels",
                  xlabel="Time",
                  ylabel="SNR")

    plotter.plots(np.arange(len(snr_base[1:])),
                  lqi_base[1:],
                  get_path(DATETIME_DIR, "LQI_Base_Station-%s" % n),
                  title="LQI's",
                  xlabel="Time",
                  ylabel="LQI")
    plotter.plot_bars(np.arange(1, n + 1)[1:],
                      consume[1:],
                      get_path(DATETIME_DIR, "energy consumption-", prefix=n),
                      ymax=1.1 * max(consume[1:]),
                      ymin=0.9 * min(consume[1:]),
                      title="Energy Consumption (%s nodes)" % n,
                      xlabel="Nodes",
                      ylabel="mJ")

    if isMoved:
        plotter.plot_bars(np.arange(1, n + 1),
                          displacement,
                          get_path(DATETIME_DIR, "Node movement-", prefix=n),
                          ymax=1.05 * max(displacement),
                          title="Node Displacement during simulation",
                          color='g',
                          xlabel="Nodes",
                          ylabel="Displacement (m)")

    sim.reset()
Beispiel #3
0
# plotting results
#print len(snr_base)
lqi_base = 6 * np.array(snr_base) + 538
#print lqi_base
plotter.plots(np.arange(len(snr_base[1:])), snr_base[1:],
              get_path(folder, "SNR_Base_Station-%s" % n),
              title="SNR levels",format='png',
              xlabel="Packet Number", ylabel="SNR")

plotter.plots(np.arange(len(snr_base[1:])), lqi_base[1:],
              get_path(folder, "LQI_Base_Station-%s" % n),
              title="LQI's",format='png',
              xlabel="Packet Number", ylabel="LQI")
plotter.plot_bars(np.arange(1, n+1), consume,
                  get_path(folder, "energy consumption-", prefix=n),
                  ymax=1.1*max(consume),
                  ymin=0.9*min(consume),format='png',
                  title="Energy Consumption (%s nodes)" % n,
                  xlabel="Nodes", ylabel="mJ")

plotter.plot_bars(np.arange(1, n+1), loss,
                  get_path(folder, "Loss Packets-", prefix=n),
                  ymax=1.1*max(loss),
                  ymin=0.9*min(loss),format='png',
                  title="Loss Packets (%s nodes)" % n,
                  xlabel="Nodes", ylabel="No.")
sim.reset()

# Create html/JS file for network Topology
plotter.gethtmlScatter(xpositions, [anchpositions, positions],
                fname=filename, folder=folder,
                xlabel="X-coordinates", ylabel="Y-coordinates", labels=['Base Station','Sensor'],
Beispiel #4
0
               header="%s\t%s" %(recovered_nodes[0][0],
                                 recovered_nodes[1][0]),
               delimiter="\t", fmt="%s", comments='')
        plotter.plots(np.arange(len(recovered_nodes[0][1])),
                      recovered_nodes[0][1],
              get_path(DATETIME_DIR, "energy_level-%s" % n),
              more_plots=[recovered_nodes[1][1]],
              title="Energy Level change",
              xlabel="Time", ylabel="Energy (Joules)",
              labels=["Node %s" % recovered_nodes[0][0],
                      "Node %s" % recovered_nodes[1][0]])

    # plotting results
    plotter.plot_bars(np.arange(1, n+1)[1:], consume[1:],
                  get_path(DATETIME_DIR, "energy consumption-", prefix=n),
                  ymax=1.1*max(consume[1:]),
                  ymin=0.9*min(consume[1:]),
                  title="Energy Consumption (%s nodes)" %n,
                  xlabel="Nodes", ylabel="mJ")

    plotter.plot_bars(np.arange(1, n+1), displacement,
                  get_path(DATETIME_DIR, "Node movement-", prefix=n),
                  ymax=1.05*max(displacement),
                  title="Node Displacement during simulation", color='g',
                  xlabel="Nodes", ylabel="Displacement (m)")

    sim.reset()
#simulation level

plotter.plots(n_range, c_power,  #[e[0] for e in n_power], [e[1] for e in n_power],
              get_path(DATETIME_DIR, "energy-Coordinator"),
              more_plots=[[e[2] for e in n_power],