minimal.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ..
  2. Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at
  3. McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/)
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. Minimal Simulation Kernel
  14. =========================
  15. Due to the many features that PythonPDEVS supports, the code is quite big and many additional steps need to be taken during simulation.
  16. Certainly with Python, this causes problems due to the lack of compilation (and consequently optimization).
  17. For this reason, but also to show the minimal simulation algorithm of PythonPDEVS, a minimal simulation kernel is added.
  18. Such a minimal kernel, even without any special features, is useful for benchmarking different algorithms, without needing to worry about the supported features.
  19. It can also be useful for end-users, if the user is only interested in the state of the simulated model.
  20. Its use is identical to the normal simulation kernel, but the import is different.
  21. Instead of importing *Simulator* from the file *simulator.py*, it needs to be imported from *minimal.py*.
  22. So the only change is the import, which becomes something like::
  23. from pypdevs.minimal import Simulator
  24. All other code remains exactly the same.
  25. Unless configuration options (apart from *setTerminationTime*) are used, as these will no longer be possible.
  26. The only supported option is *setTerminationTime*, which works exactly the same as in the normal simulation kernel.
  27. While it is still possible to define transfer functions or define allocations in the model construction, these are ignored during simulation.
  28. The polymorphic scheduler is used automatically, so the performance will automatically be optimized to the different access patterns.
  29. There is thus no need to manually specify the scheduler.