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 kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

projectclass.txt 1.1KB

  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. class {{PROJECTCLASSNAME}}(SimulationProject):
  9. @classmethod
  10. def get_binary_path(cl):
  11. return 'project.bin'
  12. def __init__(self, *args, **kwargs):
  13. super().__init__(*args, **kwargs)
  14. def set_input(self, input):
  15. """ Write into the 'input' file of ELMO tool
  16. the parameters and the challenges for the simulation """
  17. super().set_input(input)
  18. def set_input_for_each_challenge(self, input, challenge):
  19. """ Write into the 'input' file of ELMO tool
  20. the 'challenge' for the simulation """
  21. super().set_input_for_each_challenge(input, challenge)