Closed aweinert-MIT closed 2 years ago
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
@Lunna2528 you requested changes but the comment is empty. Can you please clarify the requested changes?
Successfully tested RUN_uncor
script with the following model parameter files:
Also produced the desired warnings and errors with these model files:
Issue #41 opened to improve UncorEncounterModel
support for the two balloon models.
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