openlvc / portico

Portico is an open source, cross-platform, fully supported HLA RTI implementation. Designed with modularity and flexibility in mind, Portico is a production-grade RTI for the Simulation and Training Community, so come say hi!
http://www.porticoproject.org
151 stars 81 forks source link

Centralized RTI does not merge federate extension FOM modules on join #275

Open michaelrfraser opened 6 years ago

michaelrfraser commented 6 years ago

Problem Statement

In Portico's new centralized RTI implementation, messages sent by LRCs to join a federation are eventually routed to org.portico2.rti.federation.Federation.joinFederate(Federate).

Presently the implementation ignores any extension FOM modules that the Federate called joinFederationExecution with, whereas they should be merged into the Federation's canonical object model.

Implementation Notes

Previously the following steps were used to combine multiple FOMs into one "Grand Unified Object Model"

    private ObjectModel parse( URL... urls ) throws Exception
    {
        // Parse all individual FOMs
        List<ObjectModel> foms = new ArrayList<ObjectModel>( urls.length );
        for( URL url : urls )
        {
            ObjectModel fom = FOM.parseFOM( url );
            foms.add( fom );
        }

        // Merge all foms together
        ObjectModel combined = ModelMerger.merge( foms );

        // Insert standard MIM
        ObjectModel.mommify( combined );

        // Resolve all placeholders
        ObjectModel.resolveSymbols( combined );

        return combined;
    }

This step will have to be a little different for the centralized implementation as not all FOM modules will be available at initialization, they will trickle in as each Federate calls joinFederationExecution(). The final steps of inserting the standard MIM and resolving/linking datatype symbols may have to be done each time a module is merged into the federation master object model.

Another implementation concern is: if the FOM is updated after a federate joins the execution, whether existing Federates in the execution need to be sent the updated Federation FOM. I suspect not, as a Federate is only going to be written around the Object Model it provides, however broader scope RTI factilities (eg the MOM) may require federates to have a full picture of the federation's object model.