Simulate graph states in the browser
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

29 lignes
559B

  1. """
  2. Makes a dummy post to the test server
  3. """
  4. import requests
  5. import json
  6. import abp
  7. import random
  8. import time
  9. #URL = "http://localhost:5000"
  10. URL = "https://abv.peteshadbolt.co.uk/"
  11. def test_graph():
  12. N = 50
  13. g = abp.NXGraphState(range(N))
  14. for i in range(N):
  15. g.act_cz(random.randint(0, N-1), random.randint(0, N-1))
  16. g.layout()
  17. return g
  18. if __name__ == '__main__':
  19. while True:
  20. data = json.dumps(test_graph().to_json(stringify=False))
  21. r = requests.post("{}/graph".format(URL), data=data)
  22. time.sleep(5)