Python-ELMO is a Python library which offers an encapsulation of the binary tool ELMO, in order to manipulate it easily in Python and SageMath script.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

projectclass.py 1.1KB

1234567891011121314151617181920212223242526
  1. ### In this file is defined a Python class to manipulate the simualtion project.
  2. ### - This class must be inherited from th class 'SimulationProject' (no need to import it)
  3. ### - You can use the function "write(input_file, uint, nb_bits=16)"
  4. ### to write an integer of 'nb_bits' bits in the 'input_file'.
  5. ### To get this simulation class in Python scripts, please use the functions in manage.py as
  6. ### - search_simulations(repository)
  7. ### - get_simulation(repository, classname=None)
  8. ### - get_simulation_via_classname(classname)
  9. class {{PROJECTCLASSNAME}}(SimulationProject):
  10. @classmethod
  11. def get_binary(cl):
  12. return 'project.bin'
  13. def __init__(self, *args, **kwargs):
  14. super().__init__(*args, **kwargs)
  15. def set_input(self, input):
  16. """ Write into the 'input' file of ELMO tool
  17. the parameters and the challenges for the simulation """
  18. super().set_input(input)
  19. def set_input_for_each_challenge(self, input, challenge):
  20. """ Write into the 'input' file of ELMO tool
  21. the 'challenge' for the simulation """
  22. super().set_input_for_each_challenge(input, challenge)