location.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. Location tracing
  14. ================
  15. .. note:: This feature is still being worked on and all information is therefore prone to change.
  16. Location tracing is closely linked to activity tracing. The only major difference is when the files are generated: an activity trace is only created at the end of the simulation run, whereas an location trace is created at the start of the simulation and at every GVT boundary where at least one migration happens. Location traces will always contain the time at which the location as it is presented actually went into effect.
  17. Enabling location tracing is as simple as::
  18. x, y = 20, 20
  19. model = FireSpread(x, y)
  20. sim = Simulator(model)
  21. sim.setTerminationTime(1000.0)
  22. sim.setLocationCellMap(True, x, y)
  23. sim.simulate()
  24. Note that this again shows the location in a Cell view. If this kind of visualisation is not desirable (or possible), you are advised to use standard :doc:`visualisation` using Graphviz.
  25. An example output of location tracing is given below. It isn't really spectacular, as it only shows you your allocations again.
  26. .. image:: location.png
  27. :alt: Location cell view
  28. :align: center
  29. :width: 50%
  30. Cell view visualisation is completely different from the regular :doc:`visualisation`, as it contains some domain specific information and thus more closely resembles your interpretation of the model. Drawing a 6x6 grid with the generic visualisation, would generate something non-intuitive like the 'curly' graph below.
  31. .. image:: location_normal.png
  32. :alt: Location normal view
  33. :height: 2000px
  34. :align: center