コード例 #1
0
ファイル: spatial_env.py プロジェクト: datnamer/Indra
 def plot(self):
     """
     Show where agents are in graphical form.
     """
     data = self.plot_data()
     self.scatter_plot = disp.ScatterPlot("Agent Positions",
                                          data,
                                          int(self.width),
                                          int(self.height),
                                          anim=True,
                                          data_func=self.plot_data)
     self.scatter_plot.show()
コード例 #2
0
ファイル: spatial_env.py プロジェクト: gupta-arpit/indras_net
 def plot(self):
     """
     Show where agents are in graphical form.
     """
     plot_type = self.props.get("plot_type", "SC")
     if plot_type == "LN":
         return super().plot()
     elif plot_type == "SC":
         data = self.plot_data()
         self.scatter_plot = disp.ScatterPlot(self.plot_title,
                                              data,
                                              int(self.width),
                                              int(self.height),
                                              anim=True,
                                              data_func=self.plot_data,
                                              is_headless=self.headless())
         self.image_bytes = self.scatter_plot.show()
         return self.image_bytes
コード例 #3
0
 def scatter_graph(self):
     """
     Show agent locations.
     """
     if self.has_disp():
         try:
             data = self.plot_data()
             scatter_plot = disp.ScatterPlot(
                 self.plot_title, data,
                 int(self.width), int(self.height),
                 anim=True, data_func=self.plot_data,
                 is_headless=self.headless())
             scatter_plot.show()
             return scatter_plot
         except Exception as e:
             self.user.tell("Error when drawing graph: " + str(e))
     else:
         return None
コード例 #4
0
ファイル: env.py プロジェクト: gupta-arpit/indras_net
 def scatter_graph(self):
     """
     Show agent locations.
     """
     if self.has_disp():
         try:
             data = self.plot_data()
             scatter_plot = disp.ScatterPlot(self.plot_title,
                                             data,
                                             int(self.width),
                                             int(self.height),
                                             anim=True,
                                             data_func=self.plot_data,
                                             is_headless=self.headless(),
                                             attrs=self.attrs)
             scatter_plot.show()
             return scatter_plot
         except ValueError as e:  # Exception as e:
             self.user.tell("Error when drawing scatter plot: " + str(e))
             traceback.print_stack()
     else:
         return None