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

Update to disco to be more compliant with FOM module loading #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jarrodgreene
Copy link
Contributor

Disco was previously throwing an exception if two FOM modules defined the same parameter for a class. However according to the spec, this is fine, as long as the definition is the same. This now allows duplicate parameters.

NOTE: currently assuming that parameters with the same name ARE the same, which is not necessarily the case.

Disco was previously throwing an exception if two FOM modules defined the same
parameter for a class. However according to the spec, this is fine, as long as the
definition is the same. This now allows duplicate parameters.

NOTE: currently assuming that parameters with the same name ARE the same, which is
not necessarily the case.
@jarrodgreene
Copy link
Contributor Author

@michaelrfraser these are the updates for getting the VR Forces FOM modules to load. I haven't tested outside of checking CNR starts up - so probably don't want to actually merge this (at least not yet) - just putting it in a PR so you can see the changes

"hla/rpr2/RPR-Warfare_v2.0.xml"
"hla/rpr2/RPR-Warfare_v2.0.xml",
"hla/rpr2/RPR-Aggregate_v2.0.xml",
"hla/rpr2/RPR-SE_v2.0.xml",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these extra files already included in the codebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... I don't know why they weren't included (perhaps we just never used anything in them?)

Copy link
Member

Choose a reason for hiding this comment

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

These shouldn't be needed by Disco and should be removed. Any module that is not 100% required (because there is a mapper that uses data from it) should be excluded. If other federates/applications need these models they can add them within the scope of their applications.

name, parameter.getName() );
// FIXME - we'll assume that this parameter has the same definition - which makes this fine
// but if it were defined any differently we should error out.
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally this should have equivalency checks on the parameters as per portico. Are we just treating this current change as a stop-gap to get current work out of the way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep exactly. I think the way DISCO is doing this merging would need to change somewhat fundamentally for us to be able to do such equivalency checks - as far as I can tell - the only info we have about parameters at this point is the name, so would need to rework so that we have the full definition of the existing and the incoming parameters.

Copy link
Member

@timpokorny timpokorny May 31, 2024

Choose a reason for hiding this comment

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

Disco isn't doing any FOM merging. It is reading the collective set of provided FOM modules to cache information from it so that it can reference it later. The only information required to be stored for Interactions is the name I believe, because it's the only thing from the FOM that Disco uses in operation (gets used in pubsub). I believe this check by itself should just be enough.

Copy link
Member

@timpokorny timpokorny May 31, 2024

Choose a reason for hiding this comment

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

No, I lie - Parameters are also needed (for handle lookup).

This will need to expand to just loop over all params and add them to the set of cached parameters. If the RTI allows the set of FOM modules then you know they should comply with any HLA merging rules, so there should be no issue with just cumulatively adding to the store of parameters. That is effectively what happens, so it should be OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants