"""
author: Claudio Gomes
email: claudio.gomes[at]uantwerpen.be
"""
from bokeh.plotting import figure, output_file, show
from cbdsim import Controller
from Options import Options
from CBDMultipleOutput.models.HarmonicOscilator import CircleCBDDerivative
from CBDMultipleOutput.Source.CBD import CBD

options = Options(delta = 0.01)
options.setMaxIterations(1000);
#cbdModel = EvenNumberGen("EvenNumbersGenerator")
cbdModel = CircleCBDDerivative("CircleCBDDerivative",options.getDeltaT())
# Use keep_running false for as fast as possible simulation.
cbdSimController = Controller(options, cbdModel, keep_running=False)
cbdSimController.start()

times = []
values = []
for timeValuePair in cbdModel.getSignal("neg"):
    times.append(timeValuePair.time)
    values.append(timeValuePair.value)

output_file("./plot.html", title="Plot")
p = figure(title="Something vs Otherthing", x_axis_label="Time", y_axis_label="Values")
p.line(times, values, legend="Something", line_width=1, line_color="red")
show(p)

print "DONE"
