fmdtools 2.3.2__tar.gz → 2.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. {fmdtools-2.3.2 → fmdtools-2.3.3}/LICENSE +1 -1
  2. {fmdtools-2.3.2 → fmdtools-2.3.3}/PKG-INFO +12 -12
  3. {fmdtools-2.3.2 → fmdtools-2.3.3}/README.md +9 -9
  4. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/aviate.py +1 -1
  5. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/contingency_management/model_aircraft.py +14 -6
  6. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/contingency_management/model_environment.py +3 -3
  7. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/contingency_management/model_flightplanner.py +16 -3
  8. fmdtools-2.3.3/examples/navigating_rover/model_troupe.py +1339 -0
  9. {fmdtools-2.3.2 → fmdtools-2.3.3}/fmdtools.egg-info/PKG-INFO +12 -12
  10. {fmdtools-2.3.2 → fmdtools-2.3.3}/fmdtools.egg-info/SOURCES.txt +1 -0
  11. {fmdtools-2.3.2 → fmdtools-2.3.3}/fmdtools.egg-info/requires.txt +1 -1
  12. {fmdtools-2.3.2 → fmdtools-2.3.3}/pyproject.toml +2 -2
  13. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/__init__.py +1 -1
  14. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/graph/base.py +3 -1
  15. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/history.py +5 -3
  16. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/architecture/base.py +3 -1
  17. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/sim/propagate.py +2 -3
  18. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/__init__.py +0 -0
  19. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airport_taxiway/model_asset.py +0 -0
  20. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airport_taxiway/model_atc.py +0 -0
  21. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airport_taxiway/model_common.py +0 -0
  22. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airport_taxiway/model_main.py +0 -0
  23. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airport_taxiway/test_asset.py +0 -0
  24. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airport_taxiway/test_model.py +0 -0
  25. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/__init__.py +0 -0
  26. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/__init__.py +0 -0
  27. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/aircraft.py +0 -0
  28. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/aircraftarchitecture.py +0 -0
  29. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/__init__.py +0 -0
  30. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/controlflight.py +0 -0
  31. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/flows.py +0 -0
  32. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/holdpayload.py +0 -0
  33. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/perceiveenvironment.py +0 -0
  34. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/arch/storeee.py +0 -0
  35. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/parameter.py +0 -0
  36. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/base/state.py +0 -0
  37. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/contingency_management/__init__.py +0 -0
  38. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/wildfire_response/__init__.py +0 -0
  39. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/wildfire_response/model_aircraft.py +0 -0
  40. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/wildfire_response/model_environment.py +0 -0
  41. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/airspacelib/wildfire_response/model_main.py +0 -0
  42. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/cooling_tank/__init__.py +0 -0
  43. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/cooling_tank/model_main.py +0 -0
  44. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/cooling_tank/model_optimization.py +0 -0
  45. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/cooling_tank/test_tank.py +0 -0
  46. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/electric_power_system/__init__.py +0 -0
  47. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/electric_power_system/model_main.py +0 -0
  48. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/electric_power_system/test_model.py +0 -0
  49. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/human_hazard_mitigation/__init__.py +0 -0
  50. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/human_hazard_mitigation/model_main.py +0 -0
  51. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/__init__.py +0 -0
  52. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/model_dynamic.py +0 -0
  53. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/model_hierarchical.py +0 -0
  54. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/model_rural.py +0 -0
  55. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/model_static.py +0 -0
  56. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/model_urban.py +0 -0
  57. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/script_opt_model_rural.py +0 -0
  58. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/multirotor_drone/test_multirotor.py +0 -0
  59. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/__init__.py +0 -0
  60. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/model_degradation.py +0 -0
  61. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/model_human.py +0 -0
  62. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/model_main.py +0 -0
  63. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/script_ea_analysis.py +0 -0
  64. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/script_mode_space.py +0 -0
  65. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/script_search_rover.py +0 -0
  66. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/navigating_rover/test_rover.py +0 -0
  67. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/state_communication/__init__.py +0 -0
  68. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/state_communication/model_main.py +0 -0
  69. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/state_communication/test_multiflow.py +0 -0
  70. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/__init__.py +0 -0
  71. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/model_indiv.py +0 -0
  72. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/model_main.py +0 -0
  73. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/model_stochastic.py +0 -0
  74. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/script_jointfaults.py +0 -0
  75. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/script_parallelism.py +0 -0
  76. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/test_pump.py +0 -0
  77. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/test_pump_example.py +0 -0
  78. {fmdtools-2.3.2 → fmdtools-2.3.3}/examples/water_pump/test_pump_stochastic.py +0 -0
  79. {fmdtools-2.3.2 → fmdtools-2.3.3}/fmdtools.egg-info/dependency_links.txt +0 -0
  80. {fmdtools-2.3.2 → fmdtools-2.3.3}/fmdtools.egg-info/top_level.txt +0 -0
  81. {fmdtools-2.3.2 → fmdtools-2.3.3}/setup.cfg +0 -0
  82. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/__init__.py +0 -0
  83. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/common.py +0 -0
  84. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/graph/__init__.py +0 -0
  85. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/graph/label.py +0 -0
  86. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/graph/model.py +0 -0
  87. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/graph/style.py +0 -0
  88. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/phases.py +0 -0
  89. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/result.py +0 -0
  90. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/analyze/tabulate.py +0 -0
  91. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/__init__.py +0 -0
  92. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/architecture/__init__.py +0 -0
  93. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/architecture/action.py +0 -0
  94. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/architecture/component.py +0 -0
  95. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/architecture/function.py +0 -0
  96. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/architecture/geom.py +0 -0
  97. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/base.py +0 -0
  98. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/block/__init__.py +0 -0
  99. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/block/action.py +0 -0
  100. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/block/base.py +0 -0
  101. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/block/component.py +0 -0
  102. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/block/function.py +0 -0
  103. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/__init__.py +0 -0
  104. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/base.py +0 -0
  105. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/mode.py +0 -0
  106. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/parameter.py +0 -0
  107. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/rand.py +0 -0
  108. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/state.py +0 -0
  109. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/container/time.py +0 -0
  110. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/environment.py +0 -0
  111. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/flow/__init__.py +0 -0
  112. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/flow/base.py +0 -0
  113. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/flow/commsflow.py +0 -0
  114. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/flow/multiflow.py +0 -0
  115. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/object/__init__.py +0 -0
  116. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/object/base.py +0 -0
  117. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/object/coords.py +0 -0
  118. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/object/geom.py +0 -0
  119. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/define/object/timer.py +0 -0
  120. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/sim/__init__.py +0 -0
  121. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/sim/sample.py +0 -0
  122. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/sim/scenario.py +0 -0
  123. {fmdtools-2.3.2 → fmdtools-2.3.3}/src/fmdtools/sim/search.py +0 -0
  124. {fmdtools-2.3.2 → fmdtools-2.3.3}/tests/__init__.py +0 -0
  125. {fmdtools-2.3.2 → fmdtools-2.3.3}/tests/common.py +0 -0
  126. {fmdtools-2.3.2 → fmdtools-2.3.3}/tests/test_graph.py +0 -0
  127. {fmdtools-2.3.2 → fmdtools-2.3.3}/tests/test_hierarchical.py +0 -0
  128. {fmdtools-2.3.2 → fmdtools-2.3.3}/tests/test_packages.py +0 -0
@@ -1,4 +1,4 @@
1
- fmdtools version 2.3.2
1
+ fmdtools version 2.3.3
2
2
  ---------------------------
3
3
  Apache License
4
4
  Version 2.0, January 2004
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmdtools
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: System resilience modelling, simulation, and assessment in Python
5
5
  Author: fmdtools Developers
6
6
  Maintainer-email: Daniel Hulse <daniel.e.hulse@nasa.gov>
7
- License: fmdtools version 2.3.2
7
+ License: fmdtools version 2.3.3
8
8
  ---------------------------
9
9
  Apache License
10
10
  Version 2.0, January 2004
@@ -250,7 +250,7 @@ Requires-Dist: tqdm
250
250
  Requires-Dist: networkx
251
251
  Requires-Dist: numpy>=2.0
252
252
  Requires-Dist: matplotlib>=3.7.0
253
- Requires-Dist: pandas[all]
253
+ Requires-Dist: pandas[all]>=2.2.0
254
254
  Requires-Dist: ordered-set
255
255
  Requires-Dist: dill
256
256
  Requires-Dist: recordclass==0.24
@@ -293,12 +293,12 @@ Dynamic: license-file
293
293
 
294
294
  See: [Examples](https://nasa.github.io/fmdtools/examples/Examples.html)
295
295
 
296
- <img src="/docs/_images/tutorial_fmdtools_basics.webp" width="15%"></img>
297
- <img src="/docs/_images/demo_proxthreat.webp" width="15%"></img>
298
- <img src="/docs/_images/demo_wildfire.webp" width="15%"></img>
299
- <img src="/docs/_images/paper_jcise_dsa.webp" width="15%"></img>
300
- <img src="/docs/_images/demo_urban_flight.webp" width="15%"></img>
301
- <img src="/docs/_images/demo_degradation.webp" width="15%"></img>
296
+ <img src="https://nasa.github.io/fmdtools/_images/tutorial_fmdtools_basics.webp" width="15%"></img>
297
+ <img src="https://nasa.github.io/fmdtools/_images/demo_proxthreat.webp" width="15%"></img>
298
+ <img src="https://nasa.github.io/fmdtools/_images/demo_wildfire.webp" width="15%"></img>
299
+ <img src="https://nasa.github.io/fmdtools/_images/paper_jcise_dsa.webp" width="15%"></img>
300
+ <img src="https://nasa.github.io/fmdtools/_images/demo_urban_flight.webp" width="15%"></img>
301
+ <img src="https://nasa.github.io/fmdtools/_images/demo_degradation.webp" width="15%"></img>
302
302
 
303
303
  ## About
304
304
 
@@ -392,7 +392,7 @@ More guidance on development installations is provided in [How to Contribute](ht
392
392
  Note that this version reflects the latest version on the ``main`` git branch along with any local changes. To use a particular version of ``fmdtools`` in the context of a development install you can checkout the tag corresponding to the version you want, e.g.:
393
393
 
394
394
  ```
395
- git checkout v2.3.2
395
+ git checkout v2.3.3
396
396
  ```
397
397
 
398
398
 
@@ -529,8 +529,8 @@ To cite a particular version of the fmdtools, you may use:
529
529
  author = {{NASA}},
530
530
  title = {fmdtools},
531
531
  url = {https://github.com/nasa/fmdtools},
532
- version = {2.3.2},
533
- date = {2025-3-6},
532
+ version = {2.3.3},
533
+ date = {2025-4-10},
534
534
  }
535
535
  ```
536
536
 
@@ -22,12 +22,12 @@
22
22
 
23
23
  See: [Examples](https://nasa.github.io/fmdtools/examples/Examples.html)
24
24
 
25
- <img src="/docs/_images/tutorial_fmdtools_basics.webp" width="15%"></img>
26
- <img src="/docs/_images/demo_proxthreat.webp" width="15%"></img>
27
- <img src="/docs/_images/demo_wildfire.webp" width="15%"></img>
28
- <img src="/docs/_images/paper_jcise_dsa.webp" width="15%"></img>
29
- <img src="/docs/_images/demo_urban_flight.webp" width="15%"></img>
30
- <img src="/docs/_images/demo_degradation.webp" width="15%"></img>
25
+ <img src="https://nasa.github.io/fmdtools/_images/tutorial_fmdtools_basics.webp" width="15%"></img>
26
+ <img src="https://nasa.github.io/fmdtools/_images/demo_proxthreat.webp" width="15%"></img>
27
+ <img src="https://nasa.github.io/fmdtools/_images/demo_wildfire.webp" width="15%"></img>
28
+ <img src="https://nasa.github.io/fmdtools/_images/paper_jcise_dsa.webp" width="15%"></img>
29
+ <img src="https://nasa.github.io/fmdtools/_images/demo_urban_flight.webp" width="15%"></img>
30
+ <img src="https://nasa.github.io/fmdtools/_images/demo_degradation.webp" width="15%"></img>
31
31
 
32
32
  ## About
33
33
 
@@ -121,7 +121,7 @@ More guidance on development installations is provided in [How to Contribute](ht
121
121
  Note that this version reflects the latest version on the ``main`` git branch along with any local changes. To use a particular version of ``fmdtools`` in the context of a development install you can checkout the tag corresponding to the version you want, e.g.:
122
122
 
123
123
  ```
124
- git checkout v2.3.2
124
+ git checkout v2.3.3
125
125
  ```
126
126
 
127
127
 
@@ -258,8 +258,8 @@ To cite a particular version of the fmdtools, you may use:
258
258
  author = {{NASA}},
259
259
  title = {fmdtools},
260
260
  url = {https://github.com/nasa/fmdtools},
261
- version = {2.3.2},
262
- date = {2025-3-6},
261
+ version = {2.3.3},
262
+ date = {2025-4-10},
263
263
  }
264
264
  ```
265
265
 
@@ -67,7 +67,7 @@ class Aviate(Function):
67
67
  if self.trajectories.s.z > 0.0:
68
68
  if self.electricity.s.voltage_high <= 0.0:
69
69
  self.m.set_mode('falling')
70
- else:
70
+ elif not self.m.in_mode('falling'):
71
71
  self.m.set_mode('flight')
72
72
  else:
73
73
  if self.electricity.s.voltage_high > 0.0:
@@ -94,7 +94,7 @@ class ContingencyControlParameter(Parameter):
94
94
  fuel_rate: float = 20.0
95
95
  disallowed_cost: float = 10.0
96
96
  occupied_cost: float = 20.0
97
- restricted_cost: float = 1000000.0
97
+ restricted_cost: float = 100.0
98
98
  max_distance: int = 5
99
99
  blocksize: float = 2.5
100
100
 
@@ -134,6 +134,8 @@ class ContingencyControlFlight(ControlFlight):
134
134
  else:
135
135
  if self.m.in_mode('pause'):
136
136
  self.m.set_mode('flight')
137
+ self.replan_mission()
138
+ self.s.pt = 1
137
139
  self.s.reconfigured_proxthreat = False
138
140
 
139
141
  def static_behavior(self):
@@ -173,10 +175,6 @@ class ContingencyControlFlight(ControlFlight):
173
175
  # if UAV within distance 10, require A* consideration for UAV safety
174
176
  obstacle = self.s.closest_dist <= 10
175
177
  # if battery low, bump fuel cost proportionally to current battery level
176
- if 0.0 < self.electricity.s.charge <= 25.0:
177
- fuel_rate = self.p.fuel_rate * 25000.0 / self.electricity.s.charge
178
- else:
179
- fuel_rate = self.p.fuel_rate
180
178
  curr_pt = self.trajectories.perc_traj.s.gett('x', 'y')
181
179
  new_path = grid.a_star_worldcoords(
182
180
  start_xy = curr_pt,
@@ -185,7 +183,7 @@ class ContingencyControlFlight(ControlFlight):
185
183
  disallowed_cost = self.p.disallowed_cost,
186
184
  occupied_cost = self.p.occupied_cost,
187
185
  restricted_cost = self.p.restricted_cost,
188
- fuel_rate = fuel_rate,
186
+ fuel_rate = self.p.fuel_rate,
189
187
  obstacle = obstacle
190
188
  )
191
189
 
@@ -197,6 +195,16 @@ class ContingencyControlFlight(ControlFlight):
197
195
  class ContingencyAviate(Aviate):
198
196
  """Movement of the drone. Updates encironment point."""
199
197
 
198
+ def static_behavior(self):
199
+ dists = self.environment.ga.calc_dist_to_threats("envelope", "envelope")
200
+ for name, dist in dists.items():
201
+ if dist <= 0.1:
202
+ self.m.add_fault('crash')
203
+ self.m.set_mode('falling')
204
+ self.environment.ga.points['self'].s.buffer_speed = 0.0
205
+ self.environment.ga.points[name].s.buffer_speed = 0.0
206
+ super().static_behavior()
207
+
200
208
  def dynamic_behavior(self):
201
209
  super().dynamic_behavior()
202
210
  self.environment.ga.points['self'].s.assign(self.trajectories.s, 'x', 'y', 'z')
@@ -177,7 +177,7 @@ class ContingencyThreats(GeomArchitecture):
177
177
  """Initialize drone and intruders given 'intruders' options."""
178
178
  self.add_point('self', Threat)
179
179
  if self.p.intruders == "across":
180
- s = {'buffer_speed': 3.5, 'x': 100, 'y': 0.0, 'z': 25.0,
180
+ s = {'buffer_speed': 3.3, 'x': 100, 'y': 0.0, 'z': 25.0,
181
181
  'goal_x': 0.0, 'goal_y': 100.0, 'goal_z': 25.0}
182
182
  self.add_point("uav", Threat, s=s)
183
183
  elif self.p.intruders == "middle":
@@ -266,9 +266,9 @@ if __name__ == "__main__":
266
266
  he.ga.update_positions()
267
267
  he.show()
268
268
 
269
- hc = ContingencyConditions(track=['environment'])
269
+ cc = ContingencyConditions(track=['environment'])
270
270
  from fmdtools.sim import propagate
271
- res, hist = propagate.nominal(hc)
271
+ res, hist = propagate.nominal(cc)
272
272
 
273
273
  hist.plot_trajectories('environment.ga.points.uav.s.x',
274
274
  'environment.ga.points.uav.s.y')
@@ -217,7 +217,7 @@ class DroneFlightGrid(Coords):
217
217
  restricted_cost * restricted
218
218
  )
219
219
  if (i, j) in unsafe_points:
220
- total += restricted_cost
220
+ total +=100*restricted_cost
221
221
  self.set(i, j, 'grid_costs', total)
222
222
 
223
223
  def neighbor_gen(self, j, i, max_distance):
@@ -446,5 +446,18 @@ class DroneFlightGrid(Coords):
446
446
  return path_xy
447
447
 
448
448
  if __name__ == "__main__":
449
- import doctest
450
- doctest.testmod(verbose=True)
449
+ from fmdtools_examples.airspacelib.contingency_management.model_flightplanner import DroneFlightGrid, DroneFlightGridParam
450
+ from fmdtools_examples.airspacelib.contingency_management.model_environment import ContingencyEnvironment
451
+ import numpy as np
452
+ env = ContingencyEnvironment()
453
+ param = DroneFlightGridParam(x_size=120/2.5, y_size=120/2.5, blocksize=2.5, max_cost=np.inf)
454
+ grid = DroneFlightGrid(env, p=param)
455
+ start = (45.0, 72.5)
456
+ goal = (50.0, 60.0)
457
+ path = grid.a_star_worldcoords(start_xy=start, goal_xy=goal, max_distance=5,
458
+ disallowed_cost=10.0, occupied_cost=20.0,
459
+ restricted_cost=100.0, fuel_rate= 20, obstacle=True) # *25000.0/25
460
+ print(path)
461
+
462
+ # import doctest
463
+ # doctest.testmod(verbose=True)