Exemplo n.º 1
0
 def plot(self, style="", vlines_height=1000):
     _xlabel("time")
     _ylabel(self.get_signal_type())
     _grid()
     if len(style) > 0 and style[0] == "|":
         return _vlines(self.get_times(), -vlines_height / 2, vlines_height / 2, style[1:])
     else:
         return _plot(self.get_times(), self.get_values(), style)
Exemplo n.º 2
0
    def _plot(self, plotBefore, plotAfter):      # Plots the results

        plt.figure(1, figsize=(10, 5))
        plt.subplot(121)
        barWidth = 0.3
        bars1 = plotBefore
        bars2 = plotAfter
        r1 = np.arange(len(bars1))
        r2 = [x + barWidth for x in r1]
        plt.bar(r1, bars1, width = barWidth, color = 'white', edgecolor = 'black', capsize=7, label='First iteration')
        plt.bar(r2, bars2, width = barWidth, color = 'dimgrey', edgecolor = 'black', capsize=7, label=str(self.maxIterations)+':th iteration')
        plt.xticks([r + barWidth for r in range(len(bars1))], ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'])
        plt.ylabel('Fitness score')
        plt.legend()
        plt.title('Mutation rate: '+str(self.mutationRate) + '. Population size: ' + str(self.popSize))
        plt.subplot(122)
        plt.title('Total fails')
        plt.xlabel('Iterations')
        plt._plot(self.sumFailVec, 'dimgrey')
        plt.grid()
        plt.ylabel('Fails')
        plt.show()
Exemplo n.º 3
0
 def plot(self):
     _plot(self._params['irf'])
Exemplo n.º 4
0
 def plot(self):
     _plot(self._params['irf'])