Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UncorEncounterModel class support for unconventional and due regard models #33

Merged
merged 5 commits into from
Feb 5, 2022

Conversation

aweinert-MIT
Copy link
Member

@aweinert-MIT aweinert-MIT commented Jan 28, 2022

Changed

  • Updated UncorEncounterModel and dependent functions to support most unconventional models and the due regard model. Functionality requested by and partly tested by @Wh0DKnee
  • Improved documentation and instructions in RUN_uncor script
  • Updated and streamlined unconventional model parameter files based on MIT Lincoln Laboratory Report ATC-348
  • Updated and renamed due regard model parameter file to use naming convention as the parameter files and based on MIT Lincoln Laboratory Report ATC-397

Removed

  • Removed unconventional models with v1p2 suffix

Fixed

  • Updates dbn_sample to use previous implementation if a dynamic variable depends on another dynamic variable. In release [1.4.0] dbn_sample was updated to calculate the index, j, upfront because asub2ind can introduce unwanted overhead and also preallocated events as a NaN array. In this previous release, the for ii = order_transition loop was added to identify the relationship between dynamic variables and its parents. Notably in the for ii = order_transition loop, the variable x was not updated. Now this is where the bug was introduced. If a dynamic variable was dependent on another dynamic variable (see unconventional glider model), xj = x(parents) would be equal for the element with the dynamic variable dependence. This would results in asub2ind(rj, xj) returning a negative value, which would create an error when indexing N_transition{ii}(:, j(ii)). Since the uncorrelated conventional models transition networks do not have any dynamic variables not dependent on another dynamic variable, this bug was not identified in release [1.4.0]. For this release, the bug was addressed by determining if any of the dynamic variables depend on another dynamic variable. This determines if we can calculate the index, j, upfront or via each iterate of t. If there is a dependence, it will sample the model similar to Release [1.3.0] where the events matrix was also preallocated as an empty array
  • Update UncorEncounterModel/getDynamicLimits to check that variable indices (i.e. idx_G, idx_A, etc.) are not empty. Currently this check will only pass for model structures as the uncorrelated conventional aircraft models; the unconventional models currently all lack geographic domain (G) and will not pass this check. Without this check an error would throw when trying to use a logical operator on an empty variable.
  • Update how UncorEncounterModel/sample calculates the order of variables when reorganizing the controls matrix. The model's temporal matrix is used explicitly instead of trying to infer the order from the controls matrix
  • Update UncorEncounterModel/sample to ensure that the altitude minimum (min_alt_ft) and maximum (max_alt_ft) are not empty. They can be empty if the model structure does not have boundaries defined for altitude layer, L
  • Fixed bug in UncorEncounterModel when dof.mat from em-core did not exist by checking if dot.mat actually exists
  • Update EncounterModel getters for cutpoints_transition and bounds_transition to not assume a specific order of variables. Getters now create returned valued based on the model's label_initial
  • README now instructs user to run startup script, startup_bayes. Bug first identified by @lydiaZeleke

- Update getDynamicLimits to check that variable indices (i.e. idx_G, idx_A, etc.) are not empty. Currently this check will only pass for model structures as the uncorrelated conventional aircraft models; the unconventional models currently all lack geographic domain (G) and will not pass this check
- Update how UncorEncounterModel.sample calculates the order of variables when reorganizing the controls matrix. The model's temporal matrix is used explicitly instead of trying to infer the order from the controls matrix
- Update UncorEncounterModel/sample to ensure that the altitude minimum (min_alt_ft) and maximum (max_alt_ft) are not empty. They can be empty if the model structure does not have altitude layer, L, as a variable
Updates dbn_sample to use previous implementation if a dynamic variable depends on another dynamic variable. In release 1.4.0 dbn_sample was updated to calculate the index, j, upfront because asub2ind can introduce unwanted overhead and also preallocated events as a NaN array. In this previous release, the for ii = order_transition loop was added to identify the relationship between dynamic variables and its parents. Notably in the for ii = order_transition loop, the variable x was not updated. Now this is where the bug was introduced. If a dynamic variable was dependent on another dynamic variable (see unconventional glider model), xj = x(parents) would be equal for the element with the dynamic variable dependence. This would results in asub2ind(rj, xj) returning a negative value, which would create an error when indexing N_transition{ii}(:, j(ii)). Since the uncorrelated conventional models transition networks do not have any dynamic variables not dependent on another dynamic variable, this bug was not identified in release 1.4.0. For this release, the bug was addressed by determining if any of the dynamic variables depend on another dynamic variable. This determines if we can calculate the index, j, upfront or via each iterate of t. If there is a dependence, it will sample the model similar to Release 1.3.0 where the events matrix was also preallocated as an empty array
@aweinert-MIT
Copy link
Member Author

aweinert-MIT commented Jan 28, 2022

As of commit 1af79bd only the unconventional models with the "v1p2" identifier in the filename work. This is because the "v1p2" files define the boundaries for the altitude layer, L, variable while the original "v1" files do not. These boundaries are required when sampling with the UncorEncounterModel class

@aweinert-MIT aweinert-MIT added the enhancement New feature or request label Jan 28, 2022
Copy link

@Lunna2528 Lunna2528 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ #

@aweinert-MIT
Copy link
Member Author

@Lunna2528 you requested changes but the comment is empty. Can you please clarify the requested changes?

- Update getter for cutpoints_transition and bounds_transition to not assume a specific order of variables. Getters now create returned valued based on the model's label_initial
- Fixed bug in UncorEncounterModel when dof.mat from em-core did not exist by checking if dot.mat actually exists
- Updated UncorEncounterModel constructor to warn about unconventional balloon models because they lack acceleration and turn rate dynamic variables
-  Update RUN_uncor with improved documentation and instructions
- Updated and streamlined unconventional model parameter files based on MIT Lincoln Laboratory Report ATC-348
- Updated and renamed due regard model parameter file to use naming convention as the parameter files and based on MIT Lincoln Laboratory Report ATC-397
@aweinert-MIT aweinert-MIT marked this pull request as ready for review February 5, 2022 02:58
@aweinert-MIT aweinert-MIT changed the title UncorEncounterModel class support for unconventional aircraft models UncorEncounterModel class support for unconventional and due regard models Feb 5, 2022
@aweinert-MIT
Copy link
Member Author

Successfully tested RUN_uncor script with the following model parameter files:

  • uncor_1200only_fwse_v1p2.txt
  • blimp_v1.txt
  • dueregard_v1.txt
  • fai1_v1.txt
  • fai1_v5.txt
  • glider_v1.txt
  • paraglider_v1.txt
  • paramotor_v1.txt
  • skydiving_v1.txt

Also produced the desired warnings and errors with these model files:

  • balloon_v1.txt
  • weatherballoon_v1.txt

Issue #41 opened to improve UncorEncounterModel support for the two balloon models.

@aweinert-MIT aweinert-MIT merged commit ccf2caa into master Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment