fmdtools 2.2.3__tar.gz → 2.3.1__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.2.3 → fmdtools-2.3.1}/LICENSE +1 -1
  2. {fmdtools-2.2.3 → fmdtools-2.3.1}/PKG-INFO +24 -11
  3. {fmdtools-2.2.3 → fmdtools-2.3.1}/README.md +12 -8
  4. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/__init__.py +1 -1
  5. fmdtools-2.3.1/examples/airspacelib/__init__.py +22 -0
  6. fmdtools-2.3.1/examples/airspacelib/base/__init__.py +24 -0
  7. fmdtools-2.3.1/examples/airspacelib/base/aircraft.py +48 -0
  8. fmdtools-2.3.1/examples/airspacelib/base/aircraftarchitecture.py +119 -0
  9. fmdtools-2.3.1/examples/airspacelib/base/arch/__init__.py +27 -0
  10. fmdtools-2.3.1/examples/airspacelib/base/arch/aviate.py +130 -0
  11. fmdtools-2.3.1/examples/airspacelib/base/arch/controlflight.py +212 -0
  12. fmdtools-2.3.1/examples/airspacelib/base/arch/flows.py +85 -0
  13. fmdtools-2.3.1/examples/airspacelib/base/arch/holdpayload.py +54 -0
  14. fmdtools-2.3.1/examples/airspacelib/base/arch/perceiveenvironment.py +72 -0
  15. fmdtools-2.3.1/examples/airspacelib/base/arch/storeee.py +79 -0
  16. fmdtools-2.3.1/examples/airspacelib/base/parameter.py +32 -0
  17. fmdtools-2.3.1/examples/airspacelib/base/state.py +188 -0
  18. fmdtools-2.3.1/examples/airspacelib/contingencymanagement/__init__.py +23 -0
  19. fmdtools-2.3.1/examples/airspacelib/contingencymanagement/aircraft.py +622 -0
  20. fmdtools-2.3.1/examples/airspacelib/contingencymanagement/environment.py +274 -0
  21. fmdtools-2.3.1/examples/airspacelib/contingencymanagement/flightplanner.py +450 -0
  22. fmdtools-2.3.1/examples/airspacelib/wildfireresponse/__init__.py +24 -0
  23. fmdtools-2.3.1/examples/airspacelib/wildfireresponse/aircraft.py +129 -0
  24. fmdtools-2.3.1/examples/airspacelib/wildfireresponse/environment.py +393 -0
  25. fmdtools-2.3.1/examples/airspacelib/wildfireresponse/wildfiresim.py +224 -0
  26. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/eps/eps.py +2 -0
  27. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/__init__.py +1 -1
  28. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/common.py +7 -2
  29. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/graph/base.py +318 -1
  30. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/graph/style.py +3 -3
  31. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/history.py +37 -3
  32. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/object/coords.py +16 -13
  33. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/object/geom.py +3 -2
  34. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools.egg-info/PKG-INFO +24 -11
  35. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools.egg-info/SOURCES.txt +23 -0
  36. fmdtools-2.3.1/fmdtools.egg-info/requires.txt +23 -0
  37. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools.egg-info/top_level.txt +1 -0
  38. {fmdtools-2.2.3 → fmdtools-2.3.1}/pyproject.toml +21 -3
  39. fmdtools-2.3.1/tests/__init__.py +18 -0
  40. fmdtools-2.3.1/tests/common.py +486 -0
  41. {fmdtools-2.2.3 → fmdtools-2.3.1}/tests/test_graph.py +99 -1
  42. fmdtools-2.2.3/fmdtools.egg-info/requires.txt +0 -12
  43. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/asg_demo/__init__.py +0 -0
  44. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/asg_demo/demo_model.py +0 -0
  45. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/eps/__init__.py +0 -0
  46. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/eps/test_eps.py +0 -0
  47. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multiflow_demo/__init__.py +0 -0
  48. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multiflow_demo/multiflow_demo.py +0 -0
  49. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multiflow_demo/test_multiflow.py +0 -0
  50. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/__init__.py +0 -0
  51. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/drone_mdl_dynamic.py +0 -0
  52. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/drone_mdl_hierarchical.py +0 -0
  53. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/drone_mdl_rural.py +0 -0
  54. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/drone_mdl_static.py +0 -0
  55. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/drone_mdl_urban.py +0 -0
  56. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/opt_drone_rural.py +0 -0
  57. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/multirotor/test_multirotor.py +0 -0
  58. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/__init__.py +0 -0
  59. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/ex_pump.py +0 -0
  60. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/jointfaults_ex.py +0 -0
  61. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/parallelism_methods.py +0 -0
  62. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/pump_indiv.py +0 -0
  63. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/pump_stochastic.py +0 -0
  64. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/test_pump.py +0 -0
  65. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/test_pump_example.py +0 -0
  66. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/pump/test_pump_stochastic.py +0 -0
  67. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/__init__.py +0 -0
  68. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/optimization/ea_analysis.py +0 -0
  69. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/optimization/search_rover.py +0 -0
  70. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/rover_degradation.py +0 -0
  71. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/rover_mode_space.py +0 -0
  72. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/rover_model.py +0 -0
  73. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/rover_model_human.py +0 -0
  74. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/rover/test_rover.py +0 -0
  75. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/tank/__init__.py +0 -0
  76. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/tank/tank_model.py +0 -0
  77. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/tank/tank_optimization_model.py +0 -0
  78. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/tank/test_tank.py +0 -0
  79. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/taxiway/ATC.py +0 -0
  80. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/taxiway/asset.py +0 -0
  81. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/taxiway/common.py +0 -0
  82. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/taxiway/model.py +0 -0
  83. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/taxiway/test_asset.py +0 -0
  84. {fmdtools-2.2.3 → fmdtools-2.3.1}/examples/taxiway/test_model.py +0 -0
  85. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/__init__.py +0 -0
  86. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/graph/__init__.py +0 -0
  87. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/graph/label.py +0 -0
  88. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/graph/model.py +0 -0
  89. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/phases.py +0 -0
  90. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/result.py +0 -0
  91. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/analyze/tabulate.py +0 -0
  92. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/__init__.py +0 -0
  93. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/architecture/__init__.py +0 -0
  94. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/architecture/action.py +0 -0
  95. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/architecture/base.py +0 -0
  96. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/architecture/component.py +0 -0
  97. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/architecture/function.py +0 -0
  98. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/architecture/geom.py +0 -0
  99. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/base.py +0 -0
  100. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/block/__init__.py +0 -0
  101. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/block/action.py +0 -0
  102. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/block/base.py +0 -0
  103. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/block/component.py +0 -0
  104. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/block/function.py +0 -0
  105. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/__init__.py +0 -0
  106. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/base.py +0 -0
  107. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/mode.py +0 -0
  108. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/parameter.py +0 -0
  109. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/rand.py +0 -0
  110. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/state.py +0 -0
  111. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/container/time.py +0 -0
  112. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/environment.py +0 -0
  113. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/flow/__init__.py +0 -0
  114. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/flow/base.py +0 -0
  115. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/flow/commsflow.py +0 -0
  116. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/flow/multiflow.py +0 -0
  117. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/object/__init__.py +0 -0
  118. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/object/base.py +0 -0
  119. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/define/object/timer.py +0 -0
  120. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/sim/__init__.py +0 -0
  121. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/sim/propagate.py +0 -0
  122. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/sim/sample.py +0 -0
  123. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/sim/scenario.py +0 -0
  124. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools/sim/search.py +0 -0
  125. {fmdtools-2.2.3 → fmdtools-2.3.1}/fmdtools.egg-info/dependency_links.txt +0 -0
  126. {fmdtools-2.2.3 → fmdtools-2.3.1}/setup.cfg +0 -0
  127. {fmdtools-2.2.3 → fmdtools-2.3.1}/tests/test_hierarchical.py +0 -0
  128. {fmdtools-2.2.3 → fmdtools-2.3.1}/tests/test_packages.py +0 -0
@@ -1,4 +1,4 @@
1
- fmdtools version 2.2.3
1
+ fmdtools version 2.3.1
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.2.3
3
+ Version: 2.3.1
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.2.3
7
+ License: fmdtools version 2.3.1
8
8
  ---------------------------
9
9
  Apache License
10
10
  Version 2.0, January 2004
@@ -253,10 +253,19 @@ Requires-Dist: matplotlib>=3.7.0
253
253
  Requires-Dist: pandas[all]
254
254
  Requires-Dist: ordered-set
255
255
  Requires-Dist: dill
256
- Requires-Dist: recordclass==0.23.1
256
+ Requires-Dist: recordclass==0.24
257
257
  Requires-Dist: pytest
258
258
  Requires-Dist: graphviz
259
259
  Requires-Dist: shapely>=2.0
260
+ Provides-Extra: examples
261
+ Requires-Dist: deap; extra == "examples"
262
+ Requires-Dist: pymoo; extra == "examples"
263
+ Requires-Dist: scikit-learn; extra == "examples"
264
+ Requires-Dist: multiprocess; extra == "examples"
265
+ Requires-Dist: pathos; extra == "examples"
266
+ Requires-Dist: adjustText; extra == "examples"
267
+ Provides-Extra: all
268
+ Requires-Dist: fmdtools[examples]; extra == "all"
260
269
  Dynamic: license-file
261
270
 
262
271
  [![fmdtools logo - titanic](/docs-source/figures/logo/logo-titanic.png)](https://github.com/nasa/fmdtools)
@@ -355,19 +364,24 @@ For development as well as interactive use of tutorials and models, we reccomend
355
364
  For this installation, fmdtools can be downloaded from the [fmdtools github repository](https://github.com/nasa/fmdtools/) using:
356
365
 
357
366
  ```
367
+ cd /path/to/fmdtools
358
368
  git clone https://github.com/nasa/fmdtools.git
359
369
  ```
360
370
 
361
371
  This may then be installed using:
362
372
 
363
373
  ```
364
- pip install -e "/path/to/fmdtools"
374
+ pip install -e .[all] --group dev
365
375
  ```
366
376
 
367
- 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`` you can checkout the tag corresponding to the version you want, e.g.:
377
+ Which will install both fmdtools as well as examples (`[all]` option) as well as testing and development dependencies (`--group dev` option)
378
+
379
+ More guidance on development installations is provided in [How to Contribute](https://nasa.github.io/fmdtools/docs-source/Contributions.html#how-to-contribute)
380
+
381
+ 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.:
368
382
 
369
383
  ```
370
- git checkout v2.2.3
384
+ git checkout v2.3.1
371
385
  ```
372
386
 
373
387
 
@@ -447,10 +461,9 @@ One `fmdtools` is installed, you should be able to run:
447
461
  import fmdtools
448
462
  ```
449
463
 
450
- To check the version of fmdtools, you can run the following:
464
+ To check the version of fmdtools, you can check:
451
465
  ```
452
- import importlib.metadata
453
- importlib.metadata.version("fmdtools")
466
+ fmdtools.__version__
454
467
  ```
455
468
  which should return the current version of fmdtools.
456
469
 
@@ -505,8 +518,8 @@ To cite a particular version of the fmdtools, you may use:
505
518
  author = {{NASA}},
506
519
  title = {fmdtools},
507
520
  url = {https://github.com/nasa/fmdtools},
508
- version = {2.2.3},
509
- date = {2025-12-4},
521
+ version = {2.3.1},
522
+ date = {2025-12-19},
510
523
  }
511
524
  ```
512
525
 
@@ -94,19 +94,24 @@ For development as well as interactive use of tutorials and models, we reccomend
94
94
  For this installation, fmdtools can be downloaded from the [fmdtools github repository](https://github.com/nasa/fmdtools/) using:
95
95
 
96
96
  ```
97
+ cd /path/to/fmdtools
97
98
  git clone https://github.com/nasa/fmdtools.git
98
99
  ```
99
100
 
100
101
  This may then be installed using:
101
102
 
102
103
  ```
103
- pip install -e "/path/to/fmdtools"
104
+ pip install -e .[all] --group dev
104
105
  ```
105
106
 
106
- 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`` you can checkout the tag corresponding to the version you want, e.g.:
107
+ Which will install both fmdtools as well as examples (`[all]` option) as well as testing and development dependencies (`--group dev` option)
108
+
109
+ More guidance on development installations is provided in [How to Contribute](https://nasa.github.io/fmdtools/docs-source/Contributions.html#how-to-contribute)
110
+
111
+ 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.:
107
112
 
108
113
  ```
109
- git checkout v2.2.3
114
+ git checkout v2.3.1
110
115
  ```
111
116
 
112
117
 
@@ -186,10 +191,9 @@ One `fmdtools` is installed, you should be able to run:
186
191
  import fmdtools
187
192
  ```
188
193
 
189
- To check the version of fmdtools, you can run the following:
194
+ To check the version of fmdtools, you can check:
190
195
  ```
191
- import importlib.metadata
192
- importlib.metadata.version("fmdtools")
196
+ fmdtools.__version__
193
197
  ```
194
198
  which should return the current version of fmdtools.
195
199
 
@@ -244,8 +248,8 @@ To cite a particular version of the fmdtools, you may use:
244
248
  author = {{NASA}},
245
249
  title = {fmdtools},
246
250
  url = {https://github.com/nasa/fmdtools},
247
- version = {2.2.3},
248
- date = {2025-12-4},
251
+ version = {2.3.1},
252
+ date = {2025-12-19},
249
253
  }
250
254
  ```
251
255
 
@@ -15,4 +15,4 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the
15
15
  specific language governing permissions and limitations under the License.
16
16
  """
17
17
 
18
- __all__ = ['asg_demo', 'eps', 'multirotor', 'pump', 'rover', 'tank', 'taxiway']
18
+ __all__ = ['asg_demo', 'eps', 'multirotor', 'pump', 'rover', 'tank', 'taxiway' 'airspacelib']
@@ -0,0 +1,22 @@
1
+ """
2
+ Airspace library.
3
+
4
+ Copyright © 2024, United States Government, as represented by the Administrator
5
+ of the National Aeronautics and Space Administration. All rights reserved.
6
+
7
+ The "Fault Model Design tools - fmdtools version 2" software is licensed
8
+ under the Apache License, Version 2.0 (the "License"); you may not use this
9
+ file except in compliance with the License. You may obtain a copy of the
10
+ License at http://www.apache.org/licenses/LICENSE/2.0.
11
+
12
+ Unless required by applicable law or agreed to in writing, software distributed
13
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
15
+ specific language governing permissions and limitations under the License.
16
+ """
17
+
18
+ import examples.airspacelib.base as base
19
+ import examples.airspacelib.contingencymanagement as contingencymanagement
20
+ import examples.airspacelib.wildfireresponse as wildfireresponse
21
+
22
+ __all__ = ['base', 'contingencymanagement', 'wildfireresponse']
@@ -0,0 +1,24 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Base packages for the Airspace Library.
4
+
5
+ Copyright © 2024, United States Government, as represented by the Administrator
6
+ of the National Aeronautics and Space Administration. All rights reserved.
7
+
8
+ The "Fault Model Design tools - fmdtools version 2" software is licensed
9
+ under the Apache License, Version 2.0 (the "License"); you may not use this
10
+ file except in compliance with the License. You may obtain a copy of the
11
+ License at http://www.apache.org/licenses/LICENSE/2.0.
12
+
13
+ Unless required by applicable law or agreed to in writing, software distributed
14
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
16
+ specific language governing permissions and limitations under the License.
17
+ """
18
+
19
+ import examples.airspacelib.base.aircraft as aircraft
20
+ import examples.airspacelib.base.parameter as parameter
21
+ import examples.airspacelib.base.state as state
22
+ import examples.airspacelib.base.arch as arch
23
+
24
+ __all__ = ['aircraft', 'parameter', 'state', 'arch']
@@ -0,0 +1,48 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Base aircraft for use in Airspace Library.
4
+
5
+ Copyright © 2024, United States Government, as represented by the Administrator
6
+ of the National Aeronautics and Space Administration. All rights reserved.
7
+
8
+ The "Fault Model Design tools - fmdtools version 2" software is licensed
9
+ under the Apache License, Version 2.0 (the "License"); you may not use this
10
+ file except in compliance with the License. You may obtain a copy of the
11
+ License at http://www.apache.org/licenses/LICENSE/2.0.
12
+
13
+ Unless required by applicable law or agreed to in writing, software distributed
14
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
16
+ specific language governing permissions and limitations under the License.
17
+ """
18
+ from fmdtools.define.block.function import Function
19
+
20
+ from examples.airspacelib.base.state import AircraftState
21
+ from examples.airspacelib.base.parameter import AircraftParameter
22
+
23
+
24
+ class BaseAircraft(Function):
25
+ """Base Aircraft function to be used by other models."""
26
+
27
+ __slots__ = ()
28
+ container_s = AircraftState
29
+ container_p = AircraftParameter
30
+
31
+ def indicate_at_goal(self):
32
+ """Indicate whether the aircraft is at its goal location."""
33
+ return self.s.at_goal()
34
+
35
+ def indicate_in_range(self):
36
+ """Indicate whether the aircraft is in range of its goal location."""
37
+ return self.s.in_range()
38
+
39
+ def fly_to_goal(self):
40
+ """Fly to a pre-determined goal."""
41
+ if not self.indicate_at_goal():
42
+ self.s.update_position(maxvel=self.p.max_speed)
43
+ dist = self.s.calc_dist_to_travel()
44
+ self.s.inc(fuel_status=-dist/self.p.max_range)
45
+
46
+
47
+ if __name__ == "__main__":
48
+ ba = BaseAircraft()
@@ -0,0 +1,119 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Combined aircraft architecture with all of the subfunctions in /arch.
4
+
5
+ Copyright © 2024, United States Government, as represented by the Administrator
6
+ of the National Aeronautics and Space Administration. All rights reserved.
7
+
8
+ The "Fault Model Design tools - fmdtools version 2" software is licensed
9
+ under the Apache License, Version 2.0 (the "License"); you may not use this
10
+ file except in compliance with the License. You may obtain a copy of the
11
+ License at http://www.apache.org/licenses/LICENSE/2.0.
12
+
13
+ Unless required by applicable law or agreed to in writing, software distributed
14
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
16
+ specific language governing permissions and limitations under the License.
17
+ """
18
+ from fmdtools.define.architecture.function import FunctionArchitecture
19
+ from fmdtools.define.architecture.function import FunctionArchitectureGraph
20
+ from fmdtools.define.container.parameter import Parameter
21
+ import fmdtools.sim.propagate as prop
22
+
23
+
24
+ from examples.airspacelib.base.arch.flows import Trajectories, Force, Electricity
25
+ from examples.airspacelib.base.arch.flows import AircraftEnvironment
26
+ from examples.airspacelib.base.arch.aviate import Aviate
27
+ from examples.airspacelib.base.arch.controlflight import ControlFlight
28
+ from examples.airspacelib.base.arch.storeee import StoreAndSupplyElectricity
29
+ from examples.airspacelib.base.arch.perceiveenvironment import PerceiveEnvironment
30
+ from examples.airspacelib.base.arch.holdpayload import HoldPayload
31
+
32
+
33
+ class AircraftArchParameter(Parameter):
34
+ """Overall Parameter Defining the AircraftArchitecture."""
35
+
36
+ flightplan: tuple = ((0.0, 0.0), (25.0, 25.0))
37
+ height: float = 25.0
38
+
39
+
40
+ class AircraftArchitecture(FunctionArchitecture):
41
+ """
42
+ Overall drone architecture.
43
+
44
+ Involves flows:
45
+ - force: the flow of force between physical components
46
+ - electricity: the flow of electrical energy from the power supply to functions
47
+ - trajectories: the 3d position and velocity of the aircraft
48
+ - environment: the environment the aircraft inhabits and interacts with
49
+ And functions:
50
+ - control_flight : flight planning and control
51
+ - aviate : the function that moves the drone in the x/y/z
52
+ - store_and_supply_ee : the aircraft power supply/battery
53
+ - perceive_environment : drone perception and localization
54
+ - hold_payload : the structure of the drone
55
+ """
56
+
57
+ __slots__ = ()
58
+ container_p = AircraftArchParameter
59
+
60
+ def init_architecture(self, **kwargs):
61
+ """Initialize the architecture of the aircraft."""
62
+ self.add_flow('force', Force)
63
+ self.add_flow('electricity', Electricity)
64
+ self.add_flow('trajectories', Trajectories)
65
+ self.add_flow('environment', AircraftEnvironment)
66
+
67
+ self.add_fxn('control_flight', ControlFlight,
68
+ 'trajectories', 'force', 'electricity', 'environment',
69
+ s={'flightplan': self.p.flightplan, 'height': self.p.height})
70
+ self.add_fxn('aviate', Aviate,
71
+ 'trajectories', 'force', 'electricity', 'environment')
72
+ self.add_fxn('store_and_supply_ee', StoreAndSupplyElectricity,
73
+ 'force', 'electricity')
74
+ self.add_fxn('perceive_environment', PerceiveEnvironment,
75
+ 'environment', 'force', 'electricity', 'trajectories')
76
+ self.add_fxn('hold_payload', HoldPayload, 'trajectories', 'force')
77
+
78
+ def classify(self, **kwargs):
79
+ """Classify the simulation results."""
80
+ return {'faultmodes': {*self.return_faultmodes()}}
81
+
82
+
83
+ if __name__ == "__main__":
84
+ import doctest
85
+ doctest.testmod(verbose=True)
86
+
87
+ t = Trajectories()
88
+ t.create_local('perc_traj')
89
+ cf = ControlFlight(trajectories=t)
90
+ av = Aviate(trajectories=t)
91
+
92
+ cf.dynamic_behavior()
93
+ cf.des_traj.s
94
+ av.dynamic_behavior()
95
+ av.trajectories.s
96
+
97
+ cf.dynamic_behavior()
98
+ cf.des_traj.s
99
+ av.dynamic_behavior()
100
+ av.trajectories.s
101
+
102
+ da = AircraftArchitecture(p={'flightplan':((0.0, 0.0), (25.0, 0.0), (0.0, 25.0), (25.0, 25.0))})
103
+ fg = FunctionArchitectureGraph(da)
104
+ fg.draw()
105
+
106
+ res, hist = prop.nominal(da)
107
+
108
+ res, hist = prop.one_fault(da, 'store_and_supply_ee', 'depletion', 7, to_return=['classify', 'graph'])
109
+ res.store_and_supply_ee_depletion_t7.tend.graph.draw()
110
+
111
+ hist.plot_trajectories('trajectories.s.x', 'trajectories.s.y')
112
+ hist.plot_trajectories('trajectories.s.x',
113
+ 'trajectories.s.y',
114
+ 'trajectories.s.z',
115
+ time_groups='nominal', time_ticks=1.0)
116
+
117
+ hist.plot_line('flows.electricity.s.charge',
118
+ 'fxns.control_flight.m.mode',
119
+ 'fxns.aviate.m.mode')
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Base architecture components for the Airspace library.
4
+
5
+ Copyright © 2024, United States Government, as represented by the Administrator
6
+ of the National Aeronautics and Space Administration. All rights reserved.
7
+
8
+ The "Fault Model Design tools - fmdtools version 2" software is licensed
9
+ under the Apache License, Version 2.0 (the "License"); you may not use this
10
+ file except in compliance with the License. You may obtain a copy of the
11
+ License at http://www.apache.org/licenses/LICENSE/2.0.
12
+
13
+ Unless required by applicable law or agreed to in writing, software distributed
14
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
16
+ specific language governing permissions and limitations under the License.
17
+ """
18
+
19
+ import examples.airspacelib.base.arch.aviate as aviate
20
+ import examples.airspacelib.base.arch.controlflight as controlflight
21
+ import examples.airspacelib.base.arch.flows as flows
22
+ import examples.airspacelib.base.arch.holdpayload as holdpayload
23
+ import examples.airspacelib.base.arch.perceiveenvironment as perceiveenvironment
24
+ import examples.airspacelib.base.arch.storeee as storeee
25
+
26
+ __all__ = ['aviate', 'controlflight', 'flows', 'holdpayload', 'perceiveenvironment',
27
+ 'storeee']
@@ -0,0 +1,130 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Aviate functionality.
4
+
5
+ Copyright © 2024, United States Government, as represented by the Administrator
6
+ of the National Aeronautics and Space Administration. All rights reserved.
7
+
8
+ The "Fault Model Design tools - fmdtools version 2" software is licensed
9
+ under the Apache License, Version 2.0 (the "License"); you may not use this
10
+ file except in compliance with the License. You may obtain a copy of the
11
+ License at http://www.apache.org/licenses/LICENSE/2.0.
12
+
13
+ Unless required by applicable law or agreed to in writing, software distributed
14
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
16
+ specific language governing permissions and limitations under the License.
17
+ """
18
+ from fmdtools.define.container.mode import Mode
19
+ from fmdtools.define.block.function import Function
20
+
21
+ from examples.airspacelib.base.arch.flows import Trajectories, Force, Electricity
22
+ from examples.airspacelib.base.arch.flows import AircraftEnvironment
23
+ import numpy as np
24
+
25
+ class AviateMode(Mode):
26
+ """Aviate function modes."""
27
+
28
+ opermodes = ('flight', 'idle', 'falling')
29
+ mode: str = "idle"
30
+ fault_crash = ()
31
+
32
+
33
+ class Aviate(Function):
34
+ """
35
+ Function that moves the drone within the environment.
36
+
37
+ Examples
38
+ --------
39
+ >>> t = Trajectories()
40
+ >>> t.s.put(z=100.0, goal_z=100.0, dz=0.0, dx=10.0)
41
+ >>> des_traj = t.create_local("des_traj")
42
+ >>> av = Aviate(trajectories=t)
43
+ >>> av.static_behavior()
44
+ >>> av.dynamic_behavior()
45
+ >>> av.trajectories.s.x
46
+ 10.0
47
+ >>> av.trajectories.des_traj.s.put(dx=0.0, dy=10.0)
48
+ >>> av.static_behavior()
49
+ >>> av.dynamic_behavior()
50
+ >>> av.trajectories.s.y
51
+ 10.0
52
+ """
53
+
54
+ __slots__ = ('trajectories', 'force', 'electricity', 'environment')
55
+
56
+ flow_trajectories = Trajectories
57
+ flow_force = Force
58
+ flow_electricity = Electricity
59
+ flow_environment = AircraftEnvironment
60
+ container_m = AviateMode
61
+
62
+ def static_behavior(self):
63
+ """Overall static behavior of drone (determines modes based on states)."""
64
+ if self.force.s.contact_support >= 10.0:
65
+ self.m.add_fault('crash')
66
+
67
+ if self.trajectories.s.z > 0.0:
68
+ if self.electricity.s.voltage_high <= 0.0:
69
+ self.m.set_mode('falling')
70
+ else:
71
+ self.m.set_mode('flight')
72
+ else:
73
+ if self.electricity.s.voltage_high > 0.0:
74
+ if not self.trajectories.des_traj.s.same(dx=0.0, dy=0.0):
75
+ self.m.add_fault('crash')
76
+ self.m.set_mode('idle')
77
+ elif not self.trajectories.des_traj.s.dz <= 0.0:
78
+ self.m.set_mode('flight')
79
+ else:
80
+ self.m.set_mode('idle')
81
+ else:
82
+ self.m.set_mode('idle')
83
+
84
+ if self.m.in_mode("falling", "crash"):
85
+ self.falling_behavior()
86
+ elif self.m.in_mode('flight'):
87
+ self.flight_behavior()
88
+ elif self.m.in_mode("idle"):
89
+ self.idle_behavior()
90
+
91
+ def dynamic_behavior(self):
92
+ """Overall dynamic behavior of the drone (flight, falling, and idle)."""
93
+ self.trajectories.s.increment_position()
94
+ self.trajectories.s.limit(z=(0.0, np.inf))
95
+
96
+ def flight_behavior(self):
97
+ """
98
+ Behavior when the drone is flying in the air.
99
+
100
+ The trajectory increments to a new location determined by the direction and
101
+ distance of the desired trajectory.
102
+ """
103
+ self.trajectories.s.assign(self.trajectories.des_traj.s, 'dx', 'dy', 'dz')
104
+ self.electricity.s.current_high = 1.0
105
+ self.force.s.put(lift_support=1.0)
106
+
107
+ def falling_behavior(self):
108
+ """
109
+ Behavior when falling.
110
+
111
+ The drone falls to the ground, removing all support to the drone.
112
+ """
113
+ if self.trajectories.s.z > 0.0:
114
+ #self.trajectories.s.assign(self.trajectories.des_traj.s, 'dx', 'dy')
115
+ self.trajectories.s.dz = -self.trajectories.s.z
116
+ self.force.s.put(lift_support=0.0)
117
+ else:
118
+ self.idle_behavior()
119
+
120
+ def idle_behavior(self):
121
+ """Behavior when not moving and grounded."""
122
+ self.trajectories.s.put(dx=0.0, dy=0.0, dz=0.0)
123
+ self.force.s.put(lift_support=0.0)
124
+ self.electricity.s.current_high = 0.0
125
+
126
+ if __name__ == "__main__":
127
+ import doctest
128
+ doctest.testmod(verbose=True)
129
+
130
+ av = Aviate()