EvenNumberGen_experiment.py 532 B

123456789101112131415161718192021
  1. #!/usr/bin/python3
  2. # This file was automatically generated from drawio2cbd with the command:
  3. # /home/red/git/DrawioConvert/__main__.py EvenNumberGen.xml -av -F CBD -e LCG -t 30 -f
  4. from CBD.lib.endpoints import SignalCollectorBlock
  5. from EvenNumberGen import *
  6. from CBD.simulator import Simulator
  7. import matplotlib.pyplot as plt
  8. cbd = EvenNumberGen("gen")
  9. # Run the Simulation
  10. sim = Simulator(cbd)
  11. sim.run(30.0)
  12. data = cbd.getSignalHistory('OUT1')
  13. x, y = [x for x, _ in data], [y for _, y in data]
  14. plt.scatter(x, y)
  15. plt.show()