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

IEEE1516e code references HLAprivilegeToDelete rather than HLAprivilegeToDeleteObject #258

Open michaelrfraser opened 6 years ago

michaelrfraser commented 6 years ago

Problem Statement

The HLA1516e standard prescribes the HLAprivilegeToDeleteObject attribute at the HLAobjectRoot level object. This attribute must be held by a federate in order for it to delete the object

Within portico, the name of this attribute is HLAprivilegeToDelete, which looks to be a hang-over from the 1.3 spec (in which it is named privilegeToDelete).

As a result, federates that have been written against the IEEE standard won't work, as they will fail to resolve the correctly named attribute.

Acceptance Criteria

Once fixed, I will be able to

timpokorny commented 6 years ago

I thought somewhere there was a name substitution that was able to resolve other names to the same thing (so that it worked even if you gave it privilegeToDelete). Should probably ensure that it resolves under a bunch of names.

Might also need to check the 1516 (2000) spec to make sure it wasn't hlaPrivilegeToDelete in there, although I suspect not and that I just fat-fingered it.

michaelrfraser commented 6 years ago

@timpokorny there is name substitution, so privilegeToDelete and HLAprivilegeToDelete currently get mapped to the same handle. The vanilla 1516 prescribes HLAprivilegeToDeleteObject, so I looks like it was just a copy/paste error from the 1.3 code.

I have the fix all done for this issue, but unfortunately its on my machine at home. I'll try and get it uploaded tonight and put into a PR.

ntaphd commented 4 years ago

Hi Michael/Tim, am struggling with a persistent error related to this post i think. Any help?

The .xml fragment `

HLAobjectRoot Neither Ambulance PublishSubscribe NA` **The runtime error** `RepastInit.run() BatchRunner.run() AmbulanceFederate : Creating RTIambassador AmbulanceFederate : Connecting... AmbulanceFederate : Creating Federation... ------------------------------------------------------------------- GMS: address=MSG1-15***, cluster=AmbulanceFederate, physical address=134.***.***.***:42*** ------------------------------------------------------------------- AmbulanceFederate : Created Federation AmbulanceFederate : Joined Federation as Ambulance FederateAmbassador: Successfully registered sync point: ReadyToRun FederateAmbassador: Synchronization point announced: ReadyToRun AmbulanceFederate : >>>>>>>>>> Press Enter to Continue <<<<<<<<<< AmbulanceFederate : Achieved sync point: ReadyToRun, waiting for federation... FederateAmbassador: Federation Synchronized: ReadyToRun AmbulanceFederate : Time Policy Enabled hla.rti1516e.exceptions.AttributeNotDefined: org.portico.lrc.compat.JAttributeNotDefined: PUBLISH-OBJECT: attribute [-1] not defined in object class [HLAobjectRoot.Ambulance] at org.portico.impl.hla1516e.Rti1516eAmbassador.publishObjectClassAttributes(Rti1516eAmbassador.java:1161) at ambulanceservicemodel.Federate.publishAndSubscribe(Federate.java:344) at ambulanceservicemodel.Federate.(Federate.java:200) at ambulanceservicemodel.AmbulanceServiceBuilder.build(AmbulanceServiceBuilder.java:114) at repast.simphony.dataLoader.engine.ClassNameContextBuilder.build(ClassNameContextBuilder.java:41) at repast.simphony.dataLoader.engine.DataLoaderControllerAction.runInitialize(DataLoaderControllerAction.java:48) at repast.simphony.engine.controller.DefaultController$2.visit(DefaultController.java:214) at repast.simphony.engine.controller.DefaultController$2.visit(DefaultController.java:1) at repast.simphony.util.collections.NaryTree.preOrderTraverals(NaryTree.java:287) at repast.simphony.util.collections.NaryTree.preOrderTraverals(NaryTree.java:290) at repast.simphony.util.collections.NaryTree.preOrderTraverals(NaryTree.java:290) at repast.simphony.util.collections.NaryTree.preOrderTraversal(NaryTree.java:283) at repast.simphony.engine.controller.DefaultController.runInitialize(DefaultController.java:212) at repast.simphony.engine.controller.DefaultController.runInitialize(DefaultController.java:383) at repast.simphony.batch.BatchRunner.run(BatchRunner.java:199) at repast.simphony.batch.BatchInit.run(BatchInit.java:75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at repast.simphony.runtime.RepastBatchMain.run(RepastBatchMain.java:101) at repast.simphony.runtime.RepastBatchMain.main(RepastBatchMain.java:118) Caused by: org.portico.lrc.compat.JAttributeNotDefined: PUBLISH-OBJECT: attribute [-1] not defined in object class [HLAobjectRoot.Ambulance] at org.portico.lrc.services.object.data.InterestManager.register(InterestManager.java:160) at org.portico.lrc.services.object.data.InterestManager.register(InterestManager.java:108) at org.portico.lrc.services.object.data.InterestManager.publishObjectClass(InterestManager.java:619) at org.portico.lrc.services.pubsub.handlers.outgoing.PublishObjectClassHandler.process(PublishObjectClassHandler.java:110) at org.portico.utils.messaging.MessageSink.process(MessageSink.java:187) at org.portico.impl.hla1516e.Impl1516eHelper.processMessage(Impl1516eHelper.java:130) at org.portico.impl.hla1516e.Rti1516eAmbassador.processMessage(Rti1516eAmbassador.java:5559) at org.portico.impl.hla1516e.Rti1516eAmbassador.publishObjectClassAttributes(Rti1516eAmbassador.java:1135) ... 21 more`
ntaphd commented 4 years ago

Hooday! Problem solved with Michael's suggestion.

I copied `

HLAprivilegeToDeleteObject
        <dataType>HLAtoken</dataType>
        <updateType>Static</updateType>
        <updateCondition>NA</updateCondition>
        <ownership>DivestAcquire</ownership>
        <sharing>PublishSubscribe</sharing>
        <transportation>HLAreliable</transportation>
        <order>TimeStamp</order>
     </attribute>`

From HLAstandardMIM.xml to my FOM, it works like a charm :)

Cheers