-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
- 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
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ #
@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
Successfully tested
Also produced the desired warnings and errors with these model files:
Issue #41 opened to improve |
Changed
UncorEncounterModel
and dependent functions to support most unconventional models and the due regard model. Functionality requested by and partly tested by @Wh0DKneeRUN_uncor
scriptRemoved
Fixed
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 becauseasub2ind
can introduce unwanted overhead and also preallocated events as a NaN array. In this previous release, thefor ii = order_transition
loop was added to identify the relationship between dynamic variables and its parents. Notably in the forii = order_transition
loop, the variablex
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 inasub2ind(rj, xj)
returning a negative value, which would create an error when indexingN_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 oft
. 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 arrayUncorEncounterModel/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.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 matrixUncorEncounterModel/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, LUncorEncounterModel
when dof.mat from em-core did not exist by checking if dot.mat actually existsEncounterModel
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_initialstartup_bayes
. Bug first identified by @lydiaZeleke