[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
applications/MatlabHLA_Toolbox m_files/changeIn...
From: |
certi-cvs |
Subject: |
applications/MatlabHLA_Toolbox m_files/changeIn... |
Date: |
Mon, 28 Jan 2008 21:46:27 +0000 |
CVSROOT: /sources/certi
Module name: applications
Changes by: Eric NOULARD <erk> 08/01/28 21:46:26
Added files:
MatlabHLA_Toolbox/m_files: changeInteractOrderType.m
discoverObjInst.m
stopRegForObjClass.m
federateSaveComplete.m
requestObjAttrValUp.m rtiOn.m
retract.m fedRestored.m
nextEventReq.m
subscribeInteractClass.m
getOrderingHdl.m disableTimeReg.m
enableAttrRelAdvisSwitch.m
getTransHdl.m timeAdvGrant.m
turnUpdatesOffForObjInst.m
registerFedSyncPoint.m
changeInteractTransType.m
initiateFedRestore.m
subscribeObjClassAttr.m
queryLookahead.m net2char.m
fedNotSaved.m fedNotRestored.m
char2net.m modifyLookahead.m rtiOff.m
net2double.m requestFedResSuccess.m
fedResBegun.m tick.m
changeAttrOrderType.m
turnUpdatesOnForObjInst.m
reflectAttrVal.m
unsubscribeInteractClass.m
enableAsyncDeliv.m
requestClassAttrValUp.m timeAdvReq.m
getEpsilon.m publishObjClass.m
syncPointRegSuccess.m removeObjInst.m
fedSaved.m unpublishObjClass.m
federateResNotComplete.m
federateSaveBegun.m
synchronizationPointAchieved.m
requestFedResFailed.m getParamHdl.m
createFedExec.m double2net.m
startRegForObjClass.m
disableAsyncDeliv.m queryLBTS.m
getAttrHdl.m getInteractClassHdl.m
Contents.m fedSync.m deleteObjInst.m
disableTimeConstr.m timeRegEnabled.m
queryMinNextEventTime.m
flushQueueReq.m enableTimeReg.m
getObjClassHdl.m attrOutOfScope.m
provideAttrValUpdate.m
federateSaveNotComplete.m
requestFedSave.m nextEventReqAvail.m
receiveInteract.m joinFedExec.m
timeConstrEnabled.m timeAdvReqAvail.m
queryFedTime.m syncPointRegFailed.m
registerObjInst.m turnInteractOff.m
turnInteractOn.m updateAttrVal.m
requestRetract.m
publishInteractClass.m
announceSyncPoint.m destroyFedExec.m
enableTimeConstr.m
unpublishInteractClass.m
requestFedRestore.m
federateResComplete.m resignFedExec.m
sendInteract.m initiateFedSave.m
unsubscribeObjClass.m
localDelObjInst.m
changeAttrTransType.m attrInScope.m
MatlabHLA_Toolbox/demo/Traffic-Distr1/car_ts: car_ts.m
receiveInteract.m
stopRegForObjClass.m
startRegForObjClass.m
MatlabHLA_Toolbox: COPYING README 00Content.txt 00Changes.txt
gpl.txt Makefile lesser.txt
MatlabHLA_Toolbox/federations: TrafficDistr1.fed
TwoLevelController.fed
MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_wTime:
discoverObjInst.m
timeAdvGrant.m
reflectAttrVal.m
controlFed.m
MatlabHLA_Toolbox/demo/TwoLevelController/processFed_woTime:
processFed.m
discoverObjInst.m
reflectAttrVal.m
MatlabHLA_Toolbox/demo/TwoLevelController/processFed_wTime:
discoverObjInst.m
reflectAttrVal.m
timeAdvGrant.m
processFed.m
MatlabHLA_Toolbox/demo/Traffic-Distr1/observ: observ.m
receiveInteract.m
discoverObjInst.m
removeObjInst.m
reflectAttrVal.m
MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_woTime:
discoverObjInst.m
controlFed.m
reflectAttrVal.m
MatlabHLA_Toolbox/demo/Traffic-Distr1/ped_ts:
startRegForObjClass.m
ped_ts.m
stopRegForObjClass.m
receiveInteract.m
MatlabHLA_Toolbox/demo/Traffic-Distr1: Contents.m
TrafficDistr1.fed
MatlabHLA_Toolbox/demo/Traffic-Distr1/trl_rt: trl_rt.m
turnInteractOff.m
turnInteractOn.m
MatlabHLA_Toolbox/rti: rti.cpp
MatlabHLA_Toolbox/demo/TwoLevelController:
TwoLevelController.fed
Log message:
First commit in order to import Christain Stenzel MatlabHLA_Toolbox
module
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/changeInteractOrderType.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/discoverObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/stopRegForObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/federateSaveComplete.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestObjAttrValUp.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/rtiOn.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/retract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/fedRestored.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/nextEventReq.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/subscribeInteractClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getOrderingHdl.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/disableTimeReg.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/enableAttrRelAdvisSwitch.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getTransHdl.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/timeAdvGrant.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/turnUpdatesOffForObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/registerFedSyncPoint.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/changeInteractTransType.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/initiateFedRestore.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/subscribeObjClassAttr.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/queryLookahead.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/net2char.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/fedNotSaved.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/fedNotRestored.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/char2net.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/modifyLookahead.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/rtiOff.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/net2double.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestFedResSuccess.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/fedResBegun.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/tick.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/changeAttrOrderType.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/turnUpdatesOnForObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/reflectAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/unsubscribeInteractClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/enableAsyncDeliv.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestClassAttrValUp.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/timeAdvReq.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getEpsilon.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/publishObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/syncPointRegSuccess.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/removeObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/fedSaved.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/unpublishObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/federateResNotComplete.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/federateSaveBegun.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/synchronizationPointAchieved.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestFedResFailed.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getParamHdl.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/createFedExec.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/double2net.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/startRegForObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/disableAsyncDeliv.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/queryLBTS.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getAttrHdl.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getInteractClassHdl.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/Contents.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/fedSync.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/deleteObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/disableTimeConstr.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/timeRegEnabled.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/queryMinNextEventTime.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/flushQueueReq.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/enableTimeReg.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/getObjClassHdl.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/attrOutOfScope.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/provideAttrValUpdate.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/federateSaveNotComplete.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestFedSave.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/nextEventReqAvail.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/receiveInteract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/joinFedExec.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/timeConstrEnabled.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/timeAdvReqAvail.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/queryFedTime.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/syncPointRegFailed.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/registerObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/turnInteractOff.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/turnInteractOn.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/updateAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestRetract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/publishInteractClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/announceSyncPoint.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/destroyFedExec.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/enableTimeConstr.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/unpublishInteractClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/requestFedRestore.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/federateResComplete.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/resignFedExec.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/sendInteract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/initiateFedSave.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/unsubscribeObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/localDelObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/changeAttrTransType.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/m_files/attrInScope.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/car_ts/car_ts.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/car_ts/receiveInteract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/car_ts/stopRegForObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/car_ts/startRegForObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/COPYING?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/README?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/00Content.txt?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/00Changes.txt?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/gpl.txt?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/Makefile?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/lesser.txt?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/federations/TrafficDistr1.fed?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/federations/TwoLevelController.fed?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_wTime/discoverObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_wTime/timeAdvGrant.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_wTime/reflectAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_wTime/controlFed.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_woTime/processFed.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_woTime/discoverObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_woTime/reflectAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_wTime/discoverObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_wTime/reflectAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_wTime/timeAdvGrant.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/processFed_wTime/processFed.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/observ/observ.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/observ/receiveInteract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/observ/discoverObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/observ/removeObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/observ/reflectAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_woTime/discoverObjInst.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_woTime/controlFed.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/controlFed_woTime/reflectAttrVal.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/ped_ts/startRegForObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/ped_ts/ped_ts.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/ped_ts/stopRegForObjClass.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/ped_ts/receiveInteract.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/Contents.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/TrafficDistr1.fed?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/trl_rt/trl_rt.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/trl_rt/turnInteractOff.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/Traffic-Distr1/trl_rt/turnInteractOn.m?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/rti/rti.cpp?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/MatlabHLA_Toolbox/demo/TwoLevelController/TwoLevelController.fed?cvsroot=certi&rev=1.1
Patches:
Index: m_files/changeInteractOrderType.m
===================================================================
RCS file: m_files/changeInteractOrderType.m
diff -N m_files/changeInteractOrderType.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/changeInteractOrderType.m 28 Jan 2008 21:45:57 -0000 1.1
@@ -0,0 +1,26 @@
+function except = changeInteractOrderType(theClass, theType)
+%changeInteractOrderType Change Interaction Order Type (federate initiated).
+%
+%Synopsis
+% except = changeInteractOrderType(theClass, theType)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8320, theClass, theType);
\ No newline at end of file
Index: m_files/discoverObjInst.m
===================================================================
RCS file: m_files/discoverObjInst.m
diff -N m_files/discoverObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/discoverObjInst.m 28 Jan 2008 21:45:57 -0000 1.1
@@ -0,0 +1,47 @@
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%discoverObjInst Discover Object Instance (rti initiated).
+%
+%Synopsis:
+% discoverObjInst(theObject, theObjectClass, theObjectName)
+%
+%Purpose:
+% Allows a federate to discover other objects that exist
+% in remote federates.
+
+% throw (
+% CouldNotDiscover,
+% ObjectClassNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) discoverObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/stopRegForObjClass.m
===================================================================
RCS file: m_files/stopRegForObjClass.m
diff -N m_files/stopRegForObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/stopRegForObjClass.m 28 Jan 2008 21:45:57 -0000 1.1
@@ -0,0 +1,47 @@
+function stopRegForObjClass(theClass)
+%stopRegForObjClass Stop Registration for Object Class (rti initiated).
+%
+%Synopsis:
+% stopRegForObjClass(theClass)
+%
+%Purpose:
+% To inform the federate that no other federates in the federation
+% execution are subscribed to an object class that it has published.
+
+% throw (
+% ObjectClassNotPublished,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) stopRegForObjClass>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/federateSaveComplete.m
===================================================================
RCS file: m_files/federateSaveComplete.m
diff -N m_files/federateSaveComplete.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/federateSaveComplete.m 28 Jan 2008 21:45:58 -0000 1.1
@@ -0,0 +1,27 @@
+function except = federateSaveComplete()
+%federateSaveComplete Federate Save Complete (federate initiated).
+%
+%Synopsis
+% except = federateSaveComplete()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4100);
\ No newline at end of file
Index: m_files/requestObjAttrValUp.m
===================================================================
RCS file: m_files/requestObjAttrValUp.m
diff -N m_files/requestObjAttrValUp.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestObjAttrValUp.m 28 Jan 2008 21:45:58 -0000 1.1
@@ -0,0 +1,26 @@
+function except = requestObjAttrValUp(theObject, theAttributes)
+%requestObjAttrValUp Request Object Attribute Value Update (federate
initiated).
+%
+%Synopsis
+% except = requestObjAttrValUp(theObject, theAttributes)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(6180, theObject, theAttributes);
\ No newline at end of file
Index: m_files/rtiOn.m
===================================================================
RCS file: m_files/rtiOn.m
diff -N m_files/rtiOn.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/rtiOn.m 28 Jan 2008 21:45:58 -0000 1.1
@@ -0,0 +1,23 @@
+function rtiOn()
+%rtiOn Lock Matlab/RTI/Matlab interface (rti.mex) and create ambassadors.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+rti(1);
Index: m_files/retract.m
===================================================================
RCS file: m_files/retract.m
diff -N m_files/retract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/retract.m 28 Jan 2008 21:45:58 -0000 1.1
@@ -0,0 +1,27 @@
+function except = retract(theHandle)
+%retract Retract (federate initiated).
+%
+%Synopsis
+% except = retract(theHandle)
+%
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8540, theHandle);
\ No newline at end of file
Index: m_files/fedRestored.m
===================================================================
RCS file: m_files/fedRestored.m
diff -N m_files/fedRestored.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/fedRestored.m 28 Jan 2008 21:45:58 -0000 1.1
@@ -0,0 +1,46 @@
+function except = fedRestored()
+%fedRestored Federation Restored (rti initiated).
+%
+%Synopsis
+% except = fedRestored()
+%
+%Pupose:
+% To inform the federate that the currently outstanding federation-wide
+% restoration attempt has completed successfully.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) fedRestored>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/nextEventReq.m
===================================================================
RCS file: m_files/nextEventReq.m
diff -N m_files/nextEventReq.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/nextEventReq.m 28 Jan 2008 21:45:59 -0000 1.1
@@ -0,0 +1,27 @@
+function except = nextEventReq(theTime)
+%nextEventReq Next Event Request (federate initiated).
+%
+%Synopsis
+% except = nextEventReq(theTime)
+%
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8440, theTime);
\ No newline at end of file
Index: m_files/subscribeInteractClass.m
===================================================================
RCS file: m_files/subscribeInteractClass.m
diff -N m_files/subscribeInteractClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/subscribeInteractClass.m 28 Jan 2008 21:45:59 -0000 1.1
@@ -0,0 +1,33 @@
+function except = subscribeInteractClass(theClass, active)
+%subscribeInteractClass Subscribe Interaction Class (federate
initiated).
+%
+%Synopsis
+% except = subscribeInteractClass(theClass)
+% except = subscribeInteractClass(theClass, active)
+%
+% Default: active = RTI_TRUE
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin < 2
+ except = rti(5080, theClass);
+else
+ except = rti(5080, theClass, active);
+end
\ No newline at end of file
Index: m_files/getOrderingHdl.m
===================================================================
RCS file: m_files/getOrderingHdl.m
diff -N m_files/getOrderingHdl.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getOrderingHdl.m 28 Jan 2008 21:45:59 -0000 1.1
@@ -0,0 +1,26 @@
+function [orderHdl,except] = getOrderingHdl(theName)
+%getOrderHandle Get Ordering Handle (federate initiated).
+%
+%Synopsis
+% [orderHdl, except] = getOrderingHdl(theName)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[orderHdl,except] = rti(10120, theName);
\ No newline at end of file
Index: m_files/disableTimeReg.m
===================================================================
RCS file: m_files/disableTimeReg.m
diff -N m_files/disableTimeReg.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/disableTimeReg.m 28 Jan 2008 21:45:59 -0000 1.1
@@ -0,0 +1,26 @@
+function except = disableTimeReg()
+%disableTimeReg Disable Time Regulation (federate initiated).
+%
+%Synopsis
+% except = disableTimeReg()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8380);
\ No newline at end of file
Index: m_files/enableAttrRelAdvisSwitch.m
===================================================================
RCS file: m_files/enableAttrRelAdvisSwitch.m
diff -N m_files/enableAttrRelAdvisSwitch.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/enableAttrRelAdvisSwitch.m 28 Jan 2008 21:45:59 -0000 1.1
@@ -0,0 +1,26 @@
+function except = enableAttrRelAdvisSwitch()
+%enableAttrRelAdvisSwitch Enable Attr. Relev. Advisories (fed. initiated).
+%
+%Synopsis
+% except =enableAttrRelAdvisSwitch()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(10250);
\ No newline at end of file
Index: m_files/getTransHdl.m
===================================================================
RCS file: m_files/getTransHdl.m
diff -N m_files/getTransHdl.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getTransHdl.m 28 Jan 2008 21:45:59 -0000 1.1
@@ -0,0 +1,26 @@
+function [transHdl,except] = getTransHdl(theName)
+%getTransportationHandle Get Transportation Handle (federate initiated).
+%
+%Synopsis
+% [transHdl, except] = getTransHdl(theName)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[transHdl,except] = rti(10100, theName);
\ No newline at end of file
Index: m_files/timeAdvGrant.m
===================================================================
RCS file: m_files/timeAdvGrant.m
diff -N m_files/timeAdvGrant.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/timeAdvGrant.m 28 Jan 2008 21:46:00 -0000 1.1
@@ -0,0 +1,49 @@
+function timeAdvGrant(theTime)
+%timeAdvGrant Time Advance Grant (rti initiated).
+%
+%Synopsis:
+% timeAdvGrant(theTime)
+%
+%Purpose:
+% Informs me of the current time value I have been advanced to.
+% This is in response to one of the time advance sercices.
+
+% throw (
+% InvalidFederationTime,
+% TimeAdvanceWasNotInProgress,
+% FederationTimeAlreadyPassed,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) timeAdvGrant>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/turnUpdatesOffForObjInst.m
===================================================================
RCS file: m_files/turnUpdatesOffForObjInst.m
diff -N m_files/turnUpdatesOffForObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/turnUpdatesOffForObjInst.m 28 Jan 2008 21:46:00 -0000 1.1
@@ -0,0 +1,46 @@
+function turnUpdatesOffForObjInst( theObject, theAttributes)
+%turnUpdatesOffForObjInst Turn Updates Off For Object Inst. (rti initiat.)
+%
+%Synopsis:
+% turnUpdatesOffForObjInst( theObject, theAttributes)
+%
+%Purpose:
+
+% throw (
+% ObjectNotKnown,
+% AttributeNotOwned,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) turnUpdatesOffForObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/registerFedSyncPoint.m
===================================================================
RCS file: m_files/registerFedSyncPoint.m
diff -N m_files/registerFedSyncPoint.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/registerFedSyncPoint.m 28 Jan 2008 21:46:00 -0000 1.1
@@ -0,0 +1,42 @@
+function except = registerFedSyncPoint(label,theTag,federateHdl)
+%registerFedSyncPoint Register Federation Synchronization Point (federate
initiated).
+%
+%Synopsis
+% except = registerFedSyncPoint(label,theTag)
+% except = registerFedSyncPoint(label,theTag,federateHdl)
+%
+% Two overloaded methods.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+switch nargin
+
+ case 2
+
+ except = rti(4060, label, theTag);
+
+ case 3
+
+ except = rti(4060, label, theTag, federateHdl);
+
+ otherwise
+
+ error('ERROR - try help registerFedSyncPoint');
+end
\ No newline at end of file
Index: m_files/changeInteractTransType.m
===================================================================
RCS file: m_files/changeInteractTransType.m
diff -N m_files/changeInteractTransType.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/changeInteractTransType.m 28 Jan 2008 21:46:00 -0000 1.1
@@ -0,0 +1,26 @@
+function except = changeInteractTransType(theClass,theType)
+%changeInteractTransType Change Interaction Transport Type (federate
initiated).
+%
+%Synopsis
+% except = changeInteractTransType(theClass,theType)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(6120, theClass,theType);
\ No newline at end of file
Index: m_files/initiateFedRestore.m
===================================================================
RCS file: m_files/initiateFedRestore.m
diff -N m_files/initiateFedRestore.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/initiateFedRestore.m 28 Jan 2008 21:46:00 -0000 1.1
@@ -0,0 +1,49 @@
+function except = initiateFedRestore(label,handle)
+%initiateFedRestore Initiate Federate Restore (rti initiated).
+%
+%Synopsis
+% initiateFedRestore(label,handle)
+%
+%Purpose:
+% To instruct a federate to restore its federate-managed state from the saved
+% state associated with a specified label and federate handle.
+
+% throw (
+% SpecifiedSaveLabelDoesNotExist,
+% CouldNotRestore,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) initiateFedRestore>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/subscribeObjClassAttr.m
===================================================================
RCS file: m_files/subscribeObjClassAttr.m
diff -N m_files/subscribeObjClassAttr.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/subscribeObjClassAttr.m 28 Jan 2008 21:46:00 -0000 1.1
@@ -0,0 +1,33 @@
+function except = subscribeObjClassAttr(theClass, attributeList, active)
+%subscribeObjClassAttr Subscribe Object Class Attributes (federate initiated).
+%
+%Synopsis
+% except = subscribeObjClassAttr(theClass, attributeList)
+% except = subscribeObjClassAttr(theClass, attributeList, active)
+%
+% Default: active = RTI_TRUE
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin < 3
+ except = rti(5060, theClass, attributeList);
+else
+ except = rti(5060, theClass, attributeList, active);
+end
\ No newline at end of file
Index: m_files/queryLookahead.m
===================================================================
RCS file: m_files/queryLookahead.m
diff -N m_files/queryLookahead.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/queryLookahead.m 28 Jan 2008 21:46:01 -0000 1.1
@@ -0,0 +1,26 @@
+function [val, except] = queryLookahead()
+%queryLookahead Query Lookahead (federate initiated).
+%
+%Synopsis
+% [val, except] = queryLookahead()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[val, except] = rti(8200);
Index: m_files/net2char.m
===================================================================
RCS file: m_files/net2char.m
diff -N m_files/net2char.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/net2char.m 28 Jan 2008 21:46:01 -0000 1.1
@@ -0,0 +1,27 @@
+function str = net2char(net_val)
+%net2char Convert network representation to string.
+%
+%Synopsis
+% str = net2char(net_val)
+
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+str = rti(53,net_val);
\ No newline at end of file
Index: m_files/fedNotSaved.m
===================================================================
RCS file: m_files/fedNotSaved.m
diff -N m_files/fedNotSaved.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/fedNotSaved.m 28 Jan 2008 21:46:01 -0000 1.1
@@ -0,0 +1,47 @@
+function except = fedNotSaved()
+%fedNotSaved Federation Not Saved (rti initiated).
+%
+%Synopsis
+% except = fedNotSaved()
+%
+%Pupose:
+% To inform the federate that a federation-wide save attempt has completed,
but
+% that one or more federates have failed to correctly save their state.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) fedNotSaved>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/fedNotRestored.m
===================================================================
RCS file: m_files/fedNotRestored.m
diff -N m_files/fedNotRestored.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/fedNotRestored.m 28 Jan 2008 21:46:01 -0000 1.1
@@ -0,0 +1,48 @@
+function except = fedNotRestored()
+%fedNotRestored Federation Not Restored (rti initiated).
+%
+%Synopsis:
+% fedNotRestored()
+%
+%Purpose:
+% To inform the federate that a federation-wide restoration attempt has
+% completed, but that one or more federates have failed to correctly restore
+% ther state.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) fedNotRestored>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/char2net.m
===================================================================
RCS file: m_files/char2net.m
diff -N m_files/char2net.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/char2net.m 28 Jan 2008 21:46:01 -0000 1.1
@@ -0,0 +1,26 @@
+function net_val = char2net(str)
+%char2net Converts string to network representation.
+%
+%Synopsis
+% net_val = char2net(str)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+net_val = rti(52,str);
\ No newline at end of file
Index: m_files/modifyLookahead.m
===================================================================
RCS file: m_files/modifyLookahead.m
diff -N m_files/modifyLookahead.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/modifyLookahead.m 28 Jan 2008 21:46:01 -0000 1.1
@@ -0,0 +1,28 @@
+function except = modifyLookahead(theLookahead)
+%modifyLookahead Modify Lookahead (federate initiated).
+%
+%Synopsis
+% except = modifyLookahead(theLookahead)
+%
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(8420, theLookahead);
\ No newline at end of file
Index: m_files/rtiOff.m
===================================================================
RCS file: m_files/rtiOff.m
diff -N m_files/rtiOff.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/rtiOff.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,24 @@
+function rtiOff()
+%rtiOff Unlock Matlab/RTI/Matlab interface (rti.mex) and delete
ambassadors.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+rti(2);
+clear rti;
Index: m_files/net2double.m
===================================================================
RCS file: m_files/net2double.m
diff -N m_files/net2double.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/net2double.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,26 @@
+function double_val = net2double(net_val)
+%net2double Convert network representation to double.
+%
+%Synopsis
+% double_val = net2double(net_val)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+double_val = rti(51,net_val);
\ No newline at end of file
Index: m_files/requestFedResSuccess.m
===================================================================
RCS file: m_files/requestFedResSuccess.m
diff -N m_files/requestFedResSuccess.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestFedResSuccess.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,47 @@
+function except = requestFedResSuccess(label)
+%requestFedResSuccess Request Federation Restore Succeeded (rti initiated).
+%
+%Synopsis
+% except = requestFedResSuccess(label)
+%
+%Purpose:
+% To inform a federate that a request to attempt to restore its federation
+% state has been accepted.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) requestFedResSuccess>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/fedResBegun.m
===================================================================
RCS file: m_files/fedResBegun.m
diff -N m_files/fedResBegun.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/fedResBegun.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,46 @@
+function except = fedResBegun()
+%fedResBegun Federation Restore Begun (rti initiated).
+%
+%Synopsis
+% except = fedResBegun()
+%
+%Pupose:
+% To inform the federate that a federation-wide restoration has begun.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) fedResBegun>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/tick.m
===================================================================
RCS file: m_files/tick.m
diff -N m_files/tick.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/tick.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,98 @@
+function [bool,except] = tick(minimum, maximum)
+%tick Turn Control Over to RTI (federate initiated).
+%
+%Synopsis
+% [bool,except] = tick()
+% tick('rep') - starts tick timer with default
+% period of 0.1 secs
+% tick('rep',value) - starts tick timer with the
+% period specified by value
+% tick('off') - stops the tick timer
+%
+% [bool,except] = tick(minimum, maximum)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+persistent to; %TimerObject
+
+switch nargin
+
+ case 0
+ [bool,except] = rti(10310);
+
+ case 1
+
+ switch minimum
+
+ case 'rep'
+
+ if isempty(to)
+ to = timer;
+ value = 0.1;
+ set(to,'BusyMode','queue','ExecutionMode','fixedRate', ...
+
'Period',value,'TimerFcn','[bool,except]=rti(10310);');
+ start(to);
+ else
+ disp('TimerObject already started');
+ end
+
+ case 'off'
+
+ if ~isempty(to)
+ stop(to);
+ clear to;
+ else
+ disp('No TimerObject started');
+ end
+ end
+
+ case 2
+
+ switch minimum
+
+ case 'rep'
+ if isempty(to) & isnumeric(maximum)
+ to = timer;
+ value = maximum;
+ set(to,'BusyMode','queue','ExecutionMode','fixedRate', ...
+
'Period',value,'TimerFcn','[bool,except]=rti(10310);');
+ start(to);
+ else
+ if ~isnumeric(maximum)
+ disp('Value for period must be numeric!');
+ else
+ disp('TimerObject already started');
+ end
+ end
+
+ otherwise
+ [bool,except] = rti(10310, minimum, maximum);
+ end
+
+ otherwise
+ error(['tick() with ', ...
+ int2str(nargin), ...
+ ' input args is undefined!'])
+end
+
+
+function error_handler()
+ disp(lasterr);
+return;
\ No newline at end of file
Index: m_files/changeAttrOrderType.m
===================================================================
RCS file: m_files/changeAttrOrderType.m
diff -N m_files/changeAttrOrderType.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/changeAttrOrderType.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,26 @@
+function except = changeAttrOrderType(theObject, theAttributes, theType)
+%changeAttrOrderType Change Attribute Order Type (federate initiated).
+%
+%Synopsis
+% except = changeAttrOrderType(theObject, theAttributes, theTypes)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8300, theObject, theAttributes, theType);
\ No newline at end of file
Index: m_files/turnUpdatesOnForObjInst.m
===================================================================
RCS file: m_files/turnUpdatesOnForObjInst.m
diff -N m_files/turnUpdatesOnForObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/turnUpdatesOnForObjInst.m 28 Jan 2008 21:46:02 -0000 1.1
@@ -0,0 +1,46 @@
+function turnUpdatesOnForObjInst( theObject, theAttributes)
+%turnUpdatesOnForObjInst Turn Updates On For Object Instance (rti init.)
+%
+%Synopsis:
+% turnUpdatesOnForObjInst( theObject, theAttributes)
+%
+%Purpose:
+
+% throw (
+% ObjectNotKnown,
+% AttributeNotOwned,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) turnUpdatesOnForObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/reflectAttrVal.m
===================================================================
RCS file: m_files/reflectAttrVal.m
diff -N m_files/reflectAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/reflectAttrVal.m 28 Jan 2008 21:46:03 -0000 1.1
@@ -0,0 +1,67 @@
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%reflectAttrVal Reflect Attribute Values (rti initiated).
+%
+%Synopsis:
+% reflectAttrVal(theObject,theAttributes,theTime,theTag,theHandle)
+% reflectAttrVal(theObject,theAttributes,theTag)
+%
+%Purpose:
+% Receive updates from the RTI of attributes that belong to
+% object class instances.
+
+% throw ( first method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) reflectAttrVal>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/unsubscribeInteractClass.m
===================================================================
RCS file: m_files/unsubscribeInteractClass.m
diff -N m_files/unsubscribeInteractClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/unsubscribeInteractClass.m 28 Jan 2008 21:46:03 -0000 1.1
@@ -0,0 +1,26 @@
+function except = unsubscribeInteractClass(theClass)
+%unsubscribeInteractClass Unsubscribe Interaction Class (federate
initiated).
+%
+%Synopsis
+% except = unsubscribeInteractClass(theClass)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(5140, theClass);
\ No newline at end of file
Index: m_files/enableAsyncDeliv.m
===================================================================
RCS file: m_files/enableAsyncDeliv.m
diff -N m_files/enableAsyncDeliv.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/enableAsyncDeliv.m 28 Jan 2008 21:46:03 -0000 1.1
@@ -0,0 +1,26 @@
+function except = enableAsyncDeliv()
+%enableAsyncDeliv Enable Asynchronous Delivery (federate initiated).
+%
+%Synopsis
+% except = enableAsyncDeliv()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8140);
\ No newline at end of file
Index: m_files/requestClassAttrValUp.m
===================================================================
RCS file: m_files/requestClassAttrValUp.m
diff -N m_files/requestClassAttrValUp.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestClassAttrValUp.m 28 Jan 2008 21:46:03 -0000 1.1
@@ -0,0 +1,26 @@
+function except = requestClassAttrValUp(theClass, theAttributes)
+%requestClassAttrValUp Request Class Attribute Value Update (federate
initiated).
+%
+%Synopsis
+% except = requestClassAttrValUp(theClass, theAttribute)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(6160, theClass, theAttributes);
\ No newline at end of file
Index: m_files/timeAdvReq.m
===================================================================
RCS file: m_files/timeAdvReq.m
diff -N m_files/timeAdvReq.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/timeAdvReq.m 28 Jan 2008 21:46:03 -0000 1.1
@@ -0,0 +1,26 @@
+function except = timeAdvReq(theTime)
+%timeAdvReq Time Advance Request (federate initiated).
+%
+% Synopsis:
+% except = timeAdvReq(theTime)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8080,theTime);
\ No newline at end of file
Index: m_files/getEpsilon.m
===================================================================
RCS file: m_files/getEpsilon.m
diff -N m_files/getEpsilon.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getEpsilon.m 28 Jan 2008 21:46:04 -0000 1.1
@@ -0,0 +1,26 @@
+function double_val = getEpsilon()
+%getEpsilon Get default value for federate lookahead.
+%
+%Synopsis
+% double_val = getEpsilon
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+double_val = rti(100110);
\ No newline at end of file
Index: m_files/publishObjClass.m
===================================================================
RCS file: m_files/publishObjClass.m
diff -N m_files/publishObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/publishObjClass.m 28 Jan 2008 21:46:04 -0000 1.1
@@ -0,0 +1,26 @@
+function except = publishObjClass(theClass, attributeList)
+%publishObjClass Publish Object Class (federate initiated).
+%
+%Synopsis
+% except = publishObjClass(theClass, attributeList)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(5020, theClass, attributeList);
\ No newline at end of file
Index: m_files/syncPointRegSuccess.m
===================================================================
RCS file: m_files/syncPointRegSuccess.m
diff -N m_files/syncPointRegSuccess.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/syncPointRegSuccess.m 28 Jan 2008 21:46:04 -0000 1.1
@@ -0,0 +1,47 @@
+function except = syncPointRegSuccess(label)
+%syncPointRegSuccess Synchronization Point Registration Succeeded (rti
initiated).
+%
+%Synopsis
+% except = synPointRegSuccess(label)
+%
+%Purpose:
+% To inform a federate that an attempt to register a synchronization point
has
+% succeeded.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) syncPointRegSuccess>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/removeObjInst.m
===================================================================
RCS file: m_files/removeObjInst.m
diff -N m_files/removeObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/removeObjInst.m 28 Jan 2008 21:46:04 -0000 1.1
@@ -0,0 +1,63 @@
+function removeObjInst(theObject,in2,in3,in4)
+%removeObjInst Remove Object Instance (rti initiated).
+%
+%Synopsis:
+% removeObjInst(theObject, theTime, theTag, theHandle)
+% removeObjInst(theObject, theTag)
+%Purpose:
+% Either, a remote federate has deleted one of its object instances
+% or it no longer meets my subscription criteria so the RTI is
+% telling me that I can remove the object Id from my database.
+
+% throw ( first method
+% ObjectNotKnown,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+if (nargin == 5)
+ theTime = in2;
+ theTag = in3;
+ theHandle = in4;
+ clear in2 in3 in4
+else
+ theTag = in2;
+ clear in2
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) removeObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/fedSaved.m
===================================================================
RCS file: m_files/fedSaved.m
diff -N m_files/fedSaved.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/fedSaved.m 28 Jan 2008 21:46:04 -0000 1.1
@@ -0,0 +1,46 @@
+function except = fedSaved()
+%fedSaved Federation Saved (rti initiated).
+%
+%Synopsis
+% except = fedSaved()
+%
+%Pupose:
+% To inform the federate that the currently outstanding federation-wide
+% save attempt has completed successfully.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) fedSaved>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/unpublishObjClass.m
===================================================================
RCS file: m_files/unpublishObjClass.m
diff -N m_files/unpublishObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/unpublishObjClass.m 28 Jan 2008 21:46:05 -0000 1.1
@@ -0,0 +1,26 @@
+function except = unpublishObjClass(theClass, attributeList)
+%unpublishObjClass Unpublish Object Class (federate initiated).
+%
+%Synopsis
+% except = unpublishObjClass(theClass, attributeList)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(5120, theClass);
\ No newline at end of file
Index: m_files/federateResNotComplete.m
===================================================================
RCS file: m_files/federateResNotComplete.m
diff -N m_files/federateResNotComplete.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/federateResNotComplete.m 28 Jan 2008 21:46:05 -0000 1.1
@@ -0,0 +1,27 @@
+function except = federateResNotComplete()
+%federateResNotComplete Federate Restore Not Complete (federate initiated).
+%
+%Synopsis
+% except = federateResNotComplete()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4140);
\ No newline at end of file
Index: m_files/federateSaveBegun.m
===================================================================
RCS file: m_files/federateSaveBegun.m
diff -N m_files/federateSaveBegun.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/federateSaveBegun.m 28 Jan 2008 21:46:05 -0000 1.1
@@ -0,0 +1,27 @@
+function except = federateSaveBegun()
+%federateSaveBegun Federate Save Begun (federate initiated).
+%
+%Synopsis
+% except = federateSaveBegun()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4090);
\ No newline at end of file
Index: m_files/synchronizationPointAchieved.m
===================================================================
RCS file: m_files/synchronizationPointAchieved.m
diff -N m_files/synchronizationPointAchieved.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/synchronizationPointAchieved.m 28 Jan 2008 21:46:05 -0000
1.1
@@ -0,0 +1,35 @@
+function except = synchronizationPointAchieved(label)
+%synchronizationPointAchieved Synchronization Point Achieved (federate
initiated).
+%
+%Synopsis
+% except = synchronizationPointAchieved(label)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+switch nargin
+
+ case 1
+
+ except = rti(4070, label);
+
+ otherwise
+
+ error('ERROR - try help synchronizationPointAchieved');
+end
\ No newline at end of file
Index: m_files/requestFedResFailed.m
===================================================================
RCS file: m_files/requestFedResFailed.m
diff -N m_files/requestFedResFailed.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestFedResFailed.m 28 Jan 2008 21:46:05 -0000 1.1
@@ -0,0 +1,48 @@
+function except = requestFedResFailed(label,reason)
+%requestFedResFailed Request Federation Restore Failed (rti initiated).
+%
+%Synopsis
+% except = requestFedResFailed(label,reason)
+%
+%Purpose:
+% To inform a federate that a request to attempt to restore its federation
+% state has been denied.
+
+% throw (
+% FederateInternalError)
+
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) requestFedResFailed>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/getParamHdl.m
===================================================================
RCS file: m_files/getParamHdl.m
diff -N m_files/getParamHdl.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getParamHdl.m 28 Jan 2008 21:46:06 -0000 1.1
@@ -0,0 +1,26 @@
+function [paramHdl,except] = getParamHdl(theName, whichClass)
+%getParamHdl Get Parameter Handle (federate initiated).
+%
+%Synopsis
+% [paramHdl,except] = getParamHdl(theName, whichClass)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[paramHdl,except] = rti(10080, theName, whichClass);
\ No newline at end of file
Index: m_files/createFedExec.m
===================================================================
RCS file: m_files/createFedExec.m
diff -N m_files/createFedExec.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/createFedExec.m 28 Jan 2008 21:46:06 -0000 1.1
@@ -0,0 +1,27 @@
+function except = createFedExec(executionName, FED)
+%createFedExec Create Federation Execution (federate initiated).
+%
+%Synopsis
+% except = createFedExec(executionName, FED)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4020, executionName, FED);
\ No newline at end of file
Index: m_files/double2net.m
===================================================================
RCS file: m_files/double2net.m
diff -N m_files/double2net.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/double2net.m 28 Jan 2008 21:46:06 -0000 1.1
@@ -0,0 +1,26 @@
+function net_val = double2net(double_val)
+%double2net Convert double to network representation.
+%
+%Synopsis
+% net_val = double2net(double_val)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+net_val = rti(50,double_val);
\ No newline at end of file
Index: m_files/startRegForObjClass.m
===================================================================
RCS file: m_files/startRegForObjClass.m
diff -N m_files/startRegForObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/startRegForObjClass.m 28 Jan 2008 21:46:07 -0000 1.1
@@ -0,0 +1,47 @@
+function startRegForObjClass(theClass)
+%startRegForObjClass Start Registration for Object Class (rti initiated).
+%
+%Synopsis:
+% startRegForObjClass(theClass)
+%
+%Purpose:
+% To inform the federate that other federates in the federation
+% execution have subscribed to an object class that it has
+% published.
+
+% throw (
+% ObjectClassNotPublished,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) startRegForObjClass>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/disableAsyncDeliv.m
===================================================================
RCS file: m_files/disableAsyncDeliv.m
diff -N m_files/disableAsyncDeliv.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/disableAsyncDeliv.m 28 Jan 2008 21:46:07 -0000 1.1
@@ -0,0 +1,26 @@
+function except = disableAsyncDeliv()
+%disableAsyncDeliv Disable Asynchronous Delivery (federate initiated).
+%
+%Synopsis
+% except = disableAsyncDeliv()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8340);
\ No newline at end of file
Index: m_files/queryLBTS.m
===================================================================
RCS file: m_files/queryLBTS.m
diff -N m_files/queryLBTS.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/queryLBTS.m 28 Jan 2008 21:46:07 -0000 1.1
@@ -0,0 +1,26 @@
+function [val, except] = queryLBTS()
+%queryLBTS Query LBTS (federate initiated).
+%
+%Synopsis
+% [val, except] = queryLBTS(theTime)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[val, except] = rti(8500);
Index: m_files/getAttrHdl.m
===================================================================
RCS file: m_files/getAttrHdl.m
diff -N m_files/getAttrHdl.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getAttrHdl.m 28 Jan 2008 21:46:07 -0000 1.1
@@ -0,0 +1,26 @@
+function [attrHdl,except] = getAttrHdl(theName, whichClass)
+%getAttrHdl Get Attribute Handle (federate initiated).
+%
+%Synopsis
+% [attrHdl,except] = getAttrHdl(theName, whichClass)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[attrHdl,except] = rti(10040, theName, whichClass);
\ No newline at end of file
Index: m_files/getInteractClassHdl.m
===================================================================
RCS file: m_files/getInteractClassHdl.m
diff -N m_files/getInteractClassHdl.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getInteractClassHdl.m 28 Jan 2008 21:46:08 -0000 1.1
@@ -0,0 +1,26 @@
+function [interactClassHdl,except] = getInteractClassHdl(theName)
+%getInteractClassHdl Get Interaction Class Handle (federate initiated).
+%
+%Synopsis
+% [interactClassHdl,except] = getInteractClassHdl(theName)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[interactClassHdl,except] = rti(10060, theName);
\ No newline at end of file
Index: m_files/Contents.m
===================================================================
RCS file: m_files/Contents.m
diff -N m_files/Contents.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/Contents.m 28 Jan 2008 21:46:08 -0000 1.1
@@ -0,0 +1,180 @@
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+%
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+%
+% HLA Toolbox - Matlab/RTI/Matlab-Interface
+%
+%
+% Data Conversions.
+% double2net - Convert double to network representation.
+% net2double - Convert network representation to double.
+% char2net - Convert string to network representation.
+% net2char - Convert network representation to string.
+%
+% Matlab/RTI/Matlab - Interface.
+% rti - MEX-implementation of a
bi-directional
+% Matlab <-> RTI interface.
+% Federate services (application provided) are
+% invoked via callbacks (rti -> Matlab appl.).
+% RTI services are invoked via wrapper funktions
+% (Matlab appl. -> wrapper fcn. -> rti).
+% Do not call rti directly.
+%
+%
+% Interface Initialization/Deinitialization.
+%
+% rtiOn - Lock interface and create ambassadors.
+% rtiOff - Unlock interface and delete ambassadors.
+%
+%
+% Wrapper to RTI Services (see RTI Programmer's Guide Appendix A,
+% names of services have been shortened).
+%
+% (A.1) Federation Management.
+% createFedExec - Create Federation Execution.
+% destroyFedExec - Destroy Federate Execution.
+% federateResComplete - Federate Restore Complete.
+% federateResNotComplete - Federate Restore Not Complete.
+% federateSaveBegun - Federate Save Begun.
+% federateSaveComplete - Federate Save Complete.
+% federateSaveNotComplete - Federate Save Not Complete.
+% joinFedExec - Join Federation Execution.
+% registerFedSyncPoint - Register Federation Synchronization
Point.
+% requestFedRestore - Request Federation Restore.
+% requestFedSave - Request Federation Save.
+% resignFedExec - Resign Federation Execution.
+% synchronizationPointAchieved - Synchronization Point Achieved.
+%
+% (A.2) Declaration Management.
+% publishInteractClass - Publish Interaction Class.
+% publishObjClass - Publish Object Class.
+% subscribeInteractClass - Subscribe Interaction Class.
+% subscribeObjClassAttr - Subscribe Object Class Attributes.
+% unpublishInteractClass - Unpublish Interaction Class.
+% unpublishObjClass - Unpublish Object Class.
+% unsubscribeInteractClass - Unsubscribe Interaction Class.
+% unsubscribeObjClass - Unsubscribe Object Class.
+%
+% (A.3) Object Management.
+% changeAttrTransType - Change Attribute Transportation Type.
+% chaneInteractTransType - Change Interaction Transportation Type.
+% deleteObjInst - Delete Object Instance.
+% localDelObjInst - Local Delete Object Instance.
+% registerObjInst - Register Object Instance.
+% requestClassAttrValUp - Request Class Attribute Value Update.
+% requestObjAttrValUp - Request Object Attribute Value Update.
+% sendInteract - Send Interaction.
+% updateAttrVal - Update Attribute Values.
+%
+% (A.5) Time Management.
+% changeAttrOrderType - Change Attrbute Order Type.
+% changeInteractOrderType - Change Interaction Order Type.
+% disableAsyncDeliv - Disable Asynchronous Delivery.
+% disableTimeConstr - Disable Time Constrained.
+% disableTimeReg - Disable Time Regulation.
+% enableAsyncDeliv - Enable Asynchronous Delivery.
+% enableTimeConstr - Enable Time Constrained.
+% enableTimeReg - Enable Time Regulation.
+% flushQueueReq - Flush Queue Request.
+% modifyLookahead - Modify Lookahead.
+% nextEventReq - Next Event Request.
+% nextEventReqAvail - Next Event Request Available.
+% queryFedTime - Query Federate Time.
+% queryLBTS - Query LBTS.
+% queryLookahead - Query Lookahead.
+% queryMinMaxEventTime - Query Min Max Event Time.
+% retract - Retract
+% timeAdvReq - Request advance in logical time
of federate.
+% timeAdvReqAvail - Time Advance Request Availbale.
+%
+% (A.7) Ancillary Services.
+% enableAttrRelAdvisSwitch - Enable Attr. Relev. Advisories.
+% getAttrHdl - Get Attribute Handle.
+% getInteractClassHdl - Get Interaction Class Handle.
+% getObjClassHdl - Get Object Class Handle.
+% getParamHdl - Get Parameter Handle.
+% tick - Turn Control Over to RTI.
+% getOrderingHdl - Get Ordering Handle.
+% getTransHdl - Get Transportation Handle.
+%
+% NULL Federate Services (see RTI Programmer's Guide Appendix B,
+% names of services have been shortened).
+%
+% (B.1) Federation Management.
+% announceSyncPoint - Announce Synchronization Point.
+% fedNotRestored - Federation Not Restored.
+% fedNotSaved - Federation Not Saved.
+% fedResBegun - Federation Restore Begun.
+% fedRestored - Federation Restored.
+% fedSaved - Federation Saved.
+% fedSync - Federation Synchronized.
+% initiateFedRestore - Initiate Federate Restore.
+% initiateFedSave - Initiate Federate Save.
+% requestFedResFailed - Request Federation Restore Failed.
+% requestFedResSuccess - Request Federation Restore Succeeded.
+% syncPointRegFailed - Synchronization Point Registration
Failed.
+% syncPointRegSuccess - Synchronization Point Registration
Succeeded.
+%
+% (B.2) Declaration Management.
+% startRegForObjClass - Start Registration For Object
Class.
+% stopRegForObjClass - Stop Registration For Object Class.
+% turnInteractOn - Turn Interactions On.
+% turnInteractOff - Turn Interactions Off.
+%
+% (B.3) Object Management.
+% attrInScope - Attributes In Scope.
+% attrOutOfScope - Attributes Out Of Scope.
+% discoverObjInst - Discover Object Instance.
+% receiveInteract - Receive Interactions.
+% reflectAttrVal - Reflect Attribute Values.
+% removeObjInst - Remove Object Instance.
+% provideAttrValUpdate - Provide Attribute Value Update.
+% turnUpdatesOffForObjInst - Turn Updates Off For Object Instance.
+% turnUpdatesOnForObjInst - Turn Updates On For Object Instance.
+%
+% (B.5) Time Management.
+% requestRetract - Request Retraction.
+% timeAdvGrant - Time Advance Grant.
+% timeConstrEnabled - Time Constrained Enabled.
+% timeRegEnabled - Time Regulation Enabled.
+%
+% Wrapper to RTI Classes and Supporting Types (see RTI Prog. Guide App. C).
+%
+% (C.1.5) FedTime.
+% getEpsilon - Get default value for federate lookahead.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
Index: m_files/fedSync.m
===================================================================
RCS file: m_files/fedSync.m
diff -N m_files/fedSync.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/fedSync.m 28 Jan 2008 21:46:08 -0000 1.1
@@ -0,0 +1,47 @@
+function except = fedSync(label)
+%fedSync Federation Synchronized (rti initiated).
+%
+%Synopsis
+% except = federationSynchronized(label)
+%
+%Purpose:
+% To inform a federate that a synchronization point previously announced to
+% the federate has been achieved by all relevant federates.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) fedSync>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/deleteObjInst.m
===================================================================
RCS file: m_files/deleteObjInst.m
diff -N m_files/deleteObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/deleteObjInst.m 28 Jan 2008 21:46:08 -0000 1.1
@@ -0,0 +1,33 @@
+function [eventRetractHdl,except] = deleteObjInst(theObject, in1, in2)
+%deleteObjInst Delete Object Instance (federate initiated).
+%
+%Synopsis
+% [eventRetractHdl,except] = deleteObjInst(theObject, theTime, theTag)
+% except = deleteObjInst(theObject, theTag)
+%
+% Two overloaded methods.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin < 3
+ except = rti(6080, theObject, in1);
+else
+ [eventRetractHdl,except] = rti(6080, theObject, in1, in2);
+end
\ No newline at end of file
Index: m_files/disableTimeConstr.m
===================================================================
RCS file: m_files/disableTimeConstr.m
diff -N m_files/disableTimeConstr.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/disableTimeConstr.m 28 Jan 2008 21:46:09 -0000 1.1
@@ -0,0 +1,26 @@
+function except = disableTimeConstr()
+%disableTimeConstr Disable Time Constrained (federate initiated).
+%
+%Synopsis
+% except = disableTimeConstr()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8360);
\ No newline at end of file
Index: m_files/timeRegEnabled.m
===================================================================
RCS file: m_files/timeRegEnabled.m
diff -N m_files/timeRegEnabled.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/timeRegEnabled.m 28 Jan 2008 21:46:09 -0000 1.1
@@ -0,0 +1,46 @@
+function timeRegEnabled(theFederateTime)
+%timeRegEnabled Time Regulation Enabled (rti initiated).
+%
+%Synopsis:
+% timeRegEnabled(theFederateTime)
+%
+%Purpose:
+
+% throw (
+% InvalidFederationTime,
+% EnableTimeRegulationWasNotPending,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) timeRegEnabled>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/queryMinNextEventTime.m
===================================================================
RCS file: m_files/queryMinNextEventTime.m
diff -N m_files/queryMinNextEventTime.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/queryMinNextEventTime.m 28 Jan 2008 21:46:09 -0000 1.1
@@ -0,0 +1,26 @@
+function [val, except] = queryMinNextEventTime()
+%queryMinNextEventTime Query Min Next Event Time (federate initiated).
+%
+%Synopsis
+% [val, except] = queryMinNextEventTime()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[val, except] = rti(8520);
Index: m_files/flushQueueReq.m
===================================================================
RCS file: m_files/flushQueueReq.m
diff -N m_files/flushQueueReq.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/flushQueueReq.m 28 Jan 2008 21:46:10 -0000 1.1
@@ -0,0 +1,26 @@
+function except = flushQueueReq(theTime)
+%flushQueueReq Flush Queue Request (federate initiated).
+%
+%Synopsis
+% except = flushQueueReq(theTime)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8400, theTime);
\ No newline at end of file
Index: m_files/enableTimeReg.m
===================================================================
RCS file: m_files/enableTimeReg.m
diff -N m_files/enableTimeReg.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/enableTimeReg.m 28 Jan 2008 21:46:10 -0000 1.1
@@ -0,0 +1,26 @@
+function except = enableTimeReg(theFederateTime, theLookahead)
+%enableTimeReg Enable Time Regulation (federate initiated).
+%
+%Synopsis
+% except = enableTimeReg(theFederateTime, theLookahead)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8020, theFederateTime, theLookahead);
\ No newline at end of file
Index: m_files/getObjClassHdl.m
===================================================================
RCS file: m_files/getObjClassHdl.m
diff -N m_files/getObjClassHdl.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/getObjClassHdl.m 28 Jan 2008 21:46:10 -0000 1.1
@@ -0,0 +1,26 @@
+function [objClassHdl,except] = getObjClassHdl(theName)
+%getObjClassHdl Get Object Class Handle (federate initiated).
+%
+%Synopsis
+% [objClassHdl,except] = getObjClassHdl(theName)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[objClassHdl,except] = rti(10020, theName);
\ No newline at end of file
Index: m_files/attrOutOfScope.m
===================================================================
RCS file: m_files/attrOutOfScope.m
diff -N m_files/attrOutOfScope.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/attrOutOfScope.m 28 Jan 2008 21:46:11 -0000 1.1
@@ -0,0 +1,51 @@
+function except = attrOutOfScope(theObject, theAttributes)
+%attrOutOfScope Attributes Out Of Scope (rti initiated).
+%
+%Synopsis:
+% attrOutOfScope(theObject, theAttributes)
+%
+%Purpose:
+% To advice a federate that a set of instance-attributes of a specified
+% object instance is no longer in-scope for the federate due to changes
+% in a subscription or in the update regions associated with the instance-
+% attributes.
+
+% throw (
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) attrOutOfScope>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/provideAttrValUpdate.m
===================================================================
RCS file: m_files/provideAttrValUpdate.m
diff -N m_files/provideAttrValUpdate.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/provideAttrValUpdate.m 28 Jan 2008 21:46:11 -0000 1.1
@@ -0,0 +1,48 @@
+function except = provideAttrValUpdate(theObject, theAttributes)
+%provideAttrValUpdate Provide Attribute Value Update (rti initiated).
+%
+%Synopsis
+% provideAttrValUpdate(theObject, theAttributes)
+%Purpose:
+% To inform the federate that an update of a set of locally owned instance-
+% attributes of a specified object instance has been solicited.
+
+% throw (
+% ObjectNotKnown,
+% AttributeNotKnown,
+% AttributeNotOwned,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) provideAttrValUp>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/federateSaveNotComplete.m
===================================================================
RCS file: m_files/federateSaveNotComplete.m
diff -N m_files/federateSaveNotComplete.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/federateSaveNotComplete.m 28 Jan 2008 21:46:11 -0000 1.1
@@ -0,0 +1,27 @@
+function except = federateSaveNotComplete()
+%federateSaveNotComplete Federate Save Not Complete (federate initiated).
+%
+%Synopsis
+% except = federateSaveNotComplete()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4110);
\ No newline at end of file
Index: m_files/requestFedSave.m
===================================================================
RCS file: m_files/requestFedSave.m
diff -N m_files/requestFedSave.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestFedSave.m 28 Jan 2008 21:46:12 -0000 1.1
@@ -0,0 +1,42 @@
+function except = requestFedSave(label,theTime)
+%requestFedSave Request Federation Save (federate initiated).
+%
+%Synopsis
+% except = requestFedSave(label,theTime)
+% except = requestFedSave(label)
+%
+% Two overloaded methods.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+switch nargin
+
+ case 1
+
+ except = rti(4080, label);
+
+ case 2
+
+ except = rti(4080, label, theTime);
+
+ otherwise
+
+ error('ERROR - try help requestFedSave');
+end
\ No newline at end of file
Index: m_files/nextEventReqAvail.m
===================================================================
RCS file: m_files/nextEventReqAvail.m
diff -N m_files/nextEventReqAvail.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/nextEventReqAvail.m 28 Jan 2008 21:46:12 -0000 1.1
@@ -0,0 +1,26 @@
+function except = nextEventReqAvail(theTime)
+%nextEventReqAvail Next Event Request Available (federate initiated).
+%
+%Synopsis
+% except = nextEventReqAvail(theTime)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8460, theTime);
\ No newline at end of file
Index: m_files/receiveInteract.m
===================================================================
RCS file: m_files/receiveInteract.m
diff -N m_files/receiveInteract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/receiveInteract.m 28 Jan 2008 21:46:12 -0000 1.1
@@ -0,0 +1,63 @@
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%receiveInteract Receive Interactions (rti initiated).
+%
+%Synopsis:
+% receiveInteract(theInteraction,theParameters,theTime,theTag,theHandle)
+% receiveInteract(theInteraction,theParameters,theTag)
+%
+%Purpose:
+% Receive interactions sent from remote federates.
+
+% throw ( first method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) receiveInteract>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/joinFedExec.m
===================================================================
RCS file: m_files/joinFedExec.m
diff -N m_files/joinFedExec.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/joinFedExec.m 28 Jan 2008 21:46:12 -0000 1.1
@@ -0,0 +1,26 @@
+function [federateId,except] = joinFedExec(yourName, executionName)
+%joinFedExec Join Federation Execution (federate initiated).
+%
+%Synopsis
+% [federateId,except] = joinFedExec(yourName, executionName)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[federateId,except] = rti(4040, yourName, executionName);
\ No newline at end of file
Index: m_files/timeConstrEnabled.m
===================================================================
RCS file: m_files/timeConstrEnabled.m
diff -N m_files/timeConstrEnabled.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/timeConstrEnabled.m 28 Jan 2008 21:46:12 -0000 1.1
@@ -0,0 +1,46 @@
+function timeConstrEnabled(theFederateTime)
+%timeConstrEnabled Time Constrained Enabled (rti initiated).
+%
+%Synopsis:
+% timeConstrEnabled(theFederateTime)
+%
+%Purpose:
+
+% throw (
+% InvalidFederationTime,
+% EnableTimeConstrainedWasNotPending,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) timeConstrEnabled>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/timeAdvReqAvail.m
===================================================================
RCS file: m_files/timeAdvReqAvail.m
diff -N m_files/timeAdvReqAvail.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/timeAdvReqAvail.m 28 Jan 2008 21:46:13 -0000 1.1
@@ -0,0 +1,26 @@
+function except = timeAdvReqAvail(theTime)
+%timeAdvReqAvail Time Advance Request Available (federate initiated).
+%
+% Synopsis:
+% except = timeAdvReqAvail(theTime)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8560,theTime);
\ No newline at end of file
Index: m_files/queryFedTime.m
===================================================================
RCS file: m_files/queryFedTime.m
diff -N m_files/queryFedTime.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/queryFedTime.m 28 Jan 2008 21:46:13 -0000 1.1
@@ -0,0 +1,27 @@
+function [val, except] = queryFedTime()
+%queryFedTime Query Federate Time (federate initiated).
+%
+%Synopsis
+% [val, except] = queryFedTime()
+%
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+[val, except] = rti(8480);
Index: m_files/syncPointRegFailed.m
===================================================================
RCS file: m_files/syncPointRegFailed.m
diff -N m_files/syncPointRegFailed.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/syncPointRegFailed.m 28 Jan 2008 21:46:13 -0000 1.1
@@ -0,0 +1,47 @@
+function except = syncPointRegFailed(label)
+%syncPointRegFailed Synchronization Point Registration Failed (rti initiated).
+%
+%Synopsis
+% synPointRegFailed(label)
+%
+%Purpose:
+% To inform a federate that an attempt to register a synchronization point
has
+% failed.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) syncPointRegFailed>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/registerObjInst.m
===================================================================
RCS file: m_files/registerObjInst.m
diff -N m_files/registerObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/registerObjInst.m 28 Jan 2008 21:46:13 -0000 1.1
@@ -0,0 +1,33 @@
+function [objHdl,except] = registeriObjInst(theClass,theObject)
+%registerObjInst Register Object Instance (federate initiated).
+%
+%Synopsis
+% [objHdl,except] = registeriObjInst(theClass,theObject)
+% [objHdl,except] = registeriObjInst(theClass)
+%
+% Two overloaded methods.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin < 2
+ [objHdl,except] = rti(6020, theClass);
+else
+ [objHdl,except] = rti(6020, theClass, theObject);
+end
\ No newline at end of file
Index: m_files/turnInteractOff.m
===================================================================
RCS file: m_files/turnInteractOff.m
diff -N m_files/turnInteractOff.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/turnInteractOff.m 28 Jan 2008 21:46:14 -0000 1.1
@@ -0,0 +1,48 @@
+function turnInteractOff(theHandle)
+%turnInteractOff Turn Interactions Off (rti initiated).
+%
+%Synopsis:
+% turnInteractOff(theHandle)
+%
+%Purpose:
+% To inform the federate that no other federates in the federation
+% execution are subscribed to an interaction class that it has
+% published.
+
+% throw (
+% InteractionClassNotPublished,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) turnInteractOff>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/turnInteractOn.m
===================================================================
RCS file: m_files/turnInteractOn.m
diff -N m_files/turnInteractOn.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/turnInteractOn.m 28 Jan 2008 21:46:14 -0000 1.1
@@ -0,0 +1,48 @@
+function turnInteractOn(theHandle)
+%turnInteractOn Turn Interactions on (rti initiated).
+%
+%Synopsis:
+% turnInteractOn(theHandle)
+%
+%Purpose:
+% To inform the federate that other federates in the federation
+% execution have subscribed to an interaction class that it has
+% published.
+
+% throw (
+% InteractionClassNotPublished,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) turnInteractOn>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/updateAttrVal.m
===================================================================
RCS file: m_files/updateAttrVal.m
diff -N m_files/updateAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/updateAttrVal.m 28 Jan 2008 21:46:14 -0000 1.1
@@ -0,0 +1,42 @@
+function [eventRetractHdl,except] =
updateAttrVal(obj,attrHdlValPairSet,in3,in4)
+%updateAttrVal Update Attribute Values (federate initiated).
+%
+%Synopsis
+% [eventRetractHdl,except] = updateAttrVal(theObject, theAttributes,...
+% theTime, theTag)
+% except = updateAttrVal(theObject, theAttrVal,...
+% theTag)
+%
+% Two overloaded methods.
+%
+% theAttributes is a Attribute Handle Value Pair Set represented by
+% an m x 2 cell array. The first column contains the Attribute Handles
+% as double values. The second column contains the Attribute Values
+% in a network transparent representation (see double2net and char2net).
+%
+% Attention: eventRetractHdl is in Matlab a 2-element vector.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin < 4
+ except = rti(6040, obj, attrHdlValPairSet, in3);
+else
+ [eventRetractHdl,except] = rti(6040, obj, attrHdlValPairSet, in3, in4);
+end
\ No newline at end of file
Index: m_files/requestRetract.m
===================================================================
RCS file: m_files/requestRetract.m
diff -N m_files/requestRetract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestRetract.m 28 Jan 2008 21:46:14 -0000 1.1
@@ -0,0 +1,48 @@
+function except = requestRetract(theHandle)
+%requestRetract Request Retraction (rti initiated);
+%
+%Synopsis
+% except = requestRetract(theHandle)
+%
+%Purpose:
+% To advice the federate that a previously delivered time-stamp-ordered (TSO)
+% event has been retracted.
+
+% throw (
+% EventNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) requestRetract>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/publishInteractClass.m
===================================================================
RCS file: m_files/publishInteractClass.m
diff -N m_files/publishInteractClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/publishInteractClass.m 28 Jan 2008 21:46:15 -0000 1.1
@@ -0,0 +1,26 @@
+function except = publishInteractClass(theInteraction)
+%publishInteractClass Publish Interaction Class (federate initiated).
+%
+%Synopsis
+% except = publishInteract(theInteraction)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(5040, theInteraction);
\ No newline at end of file
Index: m_files/announceSyncPoint.m
===================================================================
RCS file: m_files/announceSyncPoint.m
diff -N m_files/announceSyncPoint.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/announceSyncPoint.m 28 Jan 2008 21:46:15 -0000 1.1
@@ -0,0 +1,47 @@
+function except = announceSyncPoint(label,tag)
+%announceSyncPoint Announce Synchronization Point (rti initiated).
+%
+%Synopsis:
+% announceSyncPoint(label,tag)
+%
+%Purpose:
+% To inform the federate that synchronization based on some federation -
defined
+% semenatices has been requested.
+
+% throw (
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) announceSyncPoint>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/destroyFedExec.m
===================================================================
RCS file: m_files/destroyFedExec.m
diff -N m_files/destroyFedExec.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/destroyFedExec.m 28 Jan 2008 21:46:15 -0000 1.1
@@ -0,0 +1,26 @@
+function except = destroyFedExec(executionName)
+%destroyFedExec Destroy Federate Execution (federate initiated).
+%
+%Synopsis
+% except = destroyFedExec(executionName)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(4030, executionName);
\ No newline at end of file
Index: m_files/enableTimeConstr.m
===================================================================
RCS file: m_files/enableTimeConstr.m
diff -N m_files/enableTimeConstr.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/enableTimeConstr.m 28 Jan 2008 21:46:15 -0000 1.1
@@ -0,0 +1,26 @@
+function except = enableTimeConstr()
+%enableTimeConstr Enable Time Constrained (federate initiated).
+%
+%Synopsis
+% except = enableTimeConstr()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(8050);
\ No newline at end of file
Index: m_files/unpublishInteractClass.m
===================================================================
RCS file: m_files/unpublishInteractClass.m
diff -N m_files/unpublishInteractClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/unpublishInteractClass.m 28 Jan 2008 21:46:15 -0000 1.1
@@ -0,0 +1,26 @@
+function except = unpublishInteractClass(theInteraction)
+%unpublishInteractClass Unpublish Interaction Class (federate initiated).
+%
+%Synopsis
+% except = unpublishInteract(theInteraction)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(5100, theInteraction);
\ No newline at end of file
Index: m_files/requestFedRestore.m
===================================================================
RCS file: m_files/requestFedRestore.m
diff -N m_files/requestFedRestore.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/requestFedRestore.m 28 Jan 2008 21:46:16 -0000 1.1
@@ -0,0 +1,27 @@
+function except = requestFedRestore(label)
+%requestFedRestore requestFederationRestore (federate initiated).
+%
+%Synopsis
+% except = requestFedRestore(label)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4120, label);
\ No newline at end of file
Index: m_files/federateResComplete.m
===================================================================
RCS file: m_files/federateResComplete.m
diff -N m_files/federateResComplete.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/federateResComplete.m 28 Jan 2008 21:46:16 -0000 1.1
@@ -0,0 +1,27 @@
+function except = federateResComplete()
+%federateResComplete Federate Restore Complete (federate initiated).
+%
+%Synopsis
+% except = federateResComplete()
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+except = rti(4130);
\ No newline at end of file
Index: m_files/resignFedExec.m
===================================================================
RCS file: m_files/resignFedExec.m
diff -N m_files/resignFedExec.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/resignFedExec.m 28 Jan 2008 21:46:16 -0000 1.1
@@ -0,0 +1,36 @@
+function except = resignFedExec(resignAction)
+%resignFedExec Resign Federation Execution (federate initiated).
+%
+%Synopsis
+% except = resignFedExec(resignAction)
+%
+% resignAction Meaning
+% 'd' DELETE_OBJECTS
+% 'r' RELEASE_ATTRIBUTES
+% 'dr' DELETE_OBJECTS_AND_RELEASE_ATTRIBUTES
+% '' NO_ACTION
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin == 0
+ resignAction = ''; % NO_ACTION
+end
+
+except = rti(4050, resignAction);
\ No newline at end of file
Index: m_files/sendInteract.m
===================================================================
RCS file: m_files/sendInteract.m
diff -N m_files/sendInteract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/sendInteract.m 28 Jan 2008 21:46:17 -0000 1.1
@@ -0,0 +1,42 @@
+function [eventRetractHdl,except] = sendInteract(iact,paramHdlValPairSet,i3,i4)
+%sendInteract Send Interaction (federate initiated).
+%
+%Synopsis
+% [eventRetractHdl,except] = sendInteract(theInteraction,theParameters,...
+% theTime, theTag)
+% except = sendInteract(theInteraction, theParameters,...
+% theTag)
+%
+% Two overloaded methods.
+%
+% theParameters is a Parameter Handle Value Pair Set represented by
+% an m x 2 cell array. The first column contains the Parameter Handles
+% as double values. The second column contains the Parameter Values
+% in a network transparent representation (see double2net and char2net).
+%
+% Attention: eventRetractHdl is in Matlab a 2-element vector.
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if nargin < 4
+ except = rti(6060, iact, paramHdlValPairSet, i3);
+else
+ [eventRetractHdl,except] = rti(6060, iact, paramHdlValPairSet, i3, i4);
+end
\ No newline at end of file
Index: m_files/initiateFedSave.m
===================================================================
RCS file: m_files/initiateFedSave.m
diff -N m_files/initiateFedSave.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/initiateFedSave.m 28 Jan 2008 21:46:17 -0000 1.1
@@ -0,0 +1,46 @@
+function except = initiateFedSave(label)
+%initiateFedSave Initiate Federate Save (rti initiated).
+%
+%Synopsis
+% initiateFedSave(label)
+%
+%Purpose:
+% To instruct a federate to save its current logical time.
+
+% throw (
+% UnableToPerformSave,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) initiateFedSave>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: m_files/unsubscribeObjClass.m
===================================================================
RCS file: m_files/unsubscribeObjClass.m
diff -N m_files/unsubscribeObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/unsubscribeObjClass.m 28 Jan 2008 21:46:17 -0000 1.1
@@ -0,0 +1,26 @@
+function except = unsubscribeObjClass(theClass)
+%unsubscribeObjClass Unsubscribe Object Class (federate initiated).
+%
+%Synopsis
+% except = unsubscribeObjClassAttr(theClass)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(5160, theClass);
\ No newline at end of file
Index: m_files/localDelObjInst.m
===================================================================
RCS file: m_files/localDelObjInst.m
diff -N m_files/localDelObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/localDelObjInst.m 28 Jan 2008 21:46:17 -0000 1.1
@@ -0,0 +1,26 @@
+function except = localDelObjInst(theObject)
+%localDelObjInst Local Delete Object Instance (federate initiated).
+%
+%Synopsis
+% except = localDelObjInst(theObject)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(6140, theObject);
\ No newline at end of file
Index: m_files/changeAttrTransType.m
===================================================================
RCS file: m_files/changeAttrTransType.m
diff -N m_files/changeAttrTransType.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/changeAttrTransType.m 28 Jan 2008 21:46:18 -0000 1.1
@@ -0,0 +1,26 @@
+function except = changeAttrTransType(theObject,theAttr,theType)
+%changeAttrTransType Change Attribute Transport Type (federate initiated).
+%
+%Synopsis
+% except = changeAttributeTransType(theObject,theAttr,theType)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+except = rti(6100, theObject,theAttr,theType);
\ No newline at end of file
Index: m_files/attrInScope.m
===================================================================
RCS file: m_files/attrInScope.m
diff -N m_files/attrInScope.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m_files/attrInScope.m 28 Jan 2008 21:46:18 -0000 1.1
@@ -0,0 +1,48 @@
+function except = attrInScope(theObject, theAttributes)
+%attrInScope Attributes In Scope (rti initiated).
+%
+%Synopsis:
+% attrInScope(theObject, theAttributes)
+%
+%Purpose:
+% To advice a federate that a set of instance-attributes of a specified
+% object instance is associated with update regions intersectiong the
+% relevant subscription regions of the federate.
+
+% throw (
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+% This file is part of MatlabHLA13.
+%
+% MatlabHLA13 is free software: you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% MatlabHLA13 is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with MatlabHLA13.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) attrInScope>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/Traffic-Distr1/car_ts/car_ts.m
===================================================================
RCS file: demo/Traffic-Distr1/car_ts/car_ts.m
diff -N demo/Traffic-Distr1/car_ts/car_ts.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/car_ts/car_ts.m 28 Jan 2008 21:46:18 -0000 1.1
@@ -0,0 +1,617 @@
+function varargout = car_ts(varargin)
+%car_ts Time-Step Simulation of Car Traffic / HLA
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+% switchboard for local sub-functions
+if nargin > 0
+ [varargout{1:nargout}] = feval(varargin{:});
+ return
+end
+
+
+% main function
+%DEBUG
+global LOG
+ LOG=fopen('log.txt','w');
+
+
+global T
+ T.Current = 0; % start and current time
+ T.Step = 1; % time step
+ T.Terminate = 0; % termination flag; set to 1
+ % by car_ts('terminate_Callback')
+ T.Continue = 1; % continuation flag; set to
+ % 0 by car_ts('stop_Callback')
+ % 1 by car_ts('cont_Callback')
+ % -1 by car_ts('step_Callback')
+
+
+ car_ts('init') % model init
+
+ car_ts('hla_join') % join hla
+
+ car_ts('loop') % simulation loop
+
+ car_ts('hla_leave') % leave hla
+
+ car_ts('hla_down') % terminate hla
+return
+
+
+%--------------------------------------------------------------------
+function terminate_Callback
+%Set termination flag to 1
+
+global T
+
+ T.Terminate = 1;
+return
+
+
+%--------------------------------------------------------------------
+function stop_Callback
+%Set continue flag to 0
+
+global T
+
+ T.Continue = 0;
+return
+
+
+%--------------------------------------------------------------------
+function cont_Callback
+%Set continue flag to 1
+
+global T
+
+ T.Continue = 1;
+return
+
+
+%--------------------------------------------------------------------
+function step_Callback
+%Set continue flag to -1
+
+global T
+
+ T.Continue = -1;
+return
+
+
+%--------------------------------------------------------------------
+function init
+%Observer initialization
+
+global Cars
+ Cars.NextLhdl = 1; % next local handle
+ Cars.Lhdl = []; % local handles
+ Cars.Pos = []; % positions
+ Cars.Ghdl = []; % animation handles
+ Cars.Hhdl = []; % HLA instance handles
+ Cars.Barrier = 0; % barrier on street on/off and position
+
+ car_ts('init_anim')
+return
+
+
+%---------------------------------------------------------------
+function init_anim
+%Animation initialization
+
+ clf reset
+ cax = newplot;
+
+ set(get(cax,'Parent'), ... % figure properties
+ 'Name','car_ts', ...
+ 'NumberTitle','off', ...
+ 'DoubleBuffer','on', ... % ???, sonst Flimmern
+ 'BackingStore','off', ...
+ 'Colormap',[]);
+
+ set(cax, ... % axes properties
+ 'Visible','off', ...
+ 'Drawmode','Fast',...
+ 'NextPlot','add');
+ axis([0 20 0 20]); % 'Position'
+
+ plot([0 20],[11, 11],'k')
+ plot([0 20],[ 9, 9],'k')
+
+global Ghdl
+ Ghdl.TCurrent = text(1,18,'t = ');
+ Ghdl.Barrier = plot([9 9],[9 11],'r','Visible','off');
+
+
+ uicontrol('String','Barrier', ...
+ 'Callback','car_ts(''barrier_Callback'')', ...
+ 'Position',[230 170 60 20]);
+
+ uicontrol('String','Quit', ...
+ 'Callback','car_ts(''terminate_Callback'')');
+
+ uicontrol('String','Stop', ...
+ 'Callback','car_ts(''stop_Callback'')', ...
+ 'Position',[130 20 60 20]);
+
+ uicontrol('String','Step', ...
+ 'Callback','car_ts(''step_Callback'')', ...
+ 'Position',[230 20 60 20]);
+
+ uicontrol('String','Cont', ...
+ 'Callback','car_ts(''cont_Callback'')', ...
+ 'Position',[330 20 60 20]);
+
+ drawnow
+return
+
+
+%------------------------------------------------------------------
+function barrier_Callback(action)
+%Toggles Cars.Barrier
+
+global Cars
+
+ if nargin < 1
+
+ if Cars.Barrier
+ Cars.Barrier = 0;
+ else
+ Cars.Barrier = 9;
+ end
+
+ else
+
+ if action == 'c'
+ Cars.Barrier = 0;
+ else
+ Cars.Barrier = 9;
+ end
+ end
+
+ car_ts('barrier_anim', Cars.Barrier)
+return
+
+
+%---------------------------------------------------------------
+function barrier_anim(barr)
+%Animates Cars.Barrier
+
+global Ghdl
+
+ if barr
+ set(Ghdl.Barrier,'Visible','on');
+ else
+ set(Ghdl.Barrier,'Visible','off');
+ end
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_join
+%Join HLA
+
+global HLA
+ HLA.RttCar = []; % HLA run-time-type for car objects
+ HLA.RttCarPos = []; % HLA run-time-type for car pos. attributes
+ HLA.RttTrl = []; % HLA run-time-type for trl event class
+ HLA.RttTrlEvent = []; % HLA run-time-type for trl event parameter
+
+
+ % Connect to RTI
+ rtiOn
+
+ % Create federation
+ e = createFedExec('Traffic-Distr1','TrafficDistr1.fed');
+ if ~isempty(e) & ~strcmp(e,'FederationExecutionAlreadyExists')
+ error(['createFedExec failed: ' e])
+ end
+
+ % Join federation
+ e = 'FederationExecutionDoesNotExist';
+ while strcmp(e,'FederationExecutionDoesNotExist')
+ [federateId, e] = joinFedExec('car_ts','Traffic-Distr1');
+ pause(1)
+ end
+ if ~isempty(e)
+ error(['joinFedExec failed: ' e])
+ end
+
+
+ % RTT identification
+ HLA.RttCar = getObjClassHdl('Car');
+ HLA.RttCarPos = getAttrHdl( 'Pos', HLA.RttCar);
+
+ HLA.RttTrl = getInteractClassHdl('Trl');
+ HLA.RttTrlEvent = getParamHdl( 'Event', HLA.RttTrl);
+
+
+ % Publish Car
+ publishObjClass(HLA.RttCar, HLA.RttCarPos);
+ % Wenn durch ein anderes Federate subscribeObjClassAttr()
+ % aufgerufen wird, erhaelt dieses Federate den startRegForObjClass()
+ % Callback.
+ % Dieser Informationsmechanismus koennte hier mit
+ % disableClassRelevanceAdvisorySwitch() abgeschaltet werden.
+ % Hier wurde aber nur der startRegForObjClass() Callback als
+ % Nop implementiert.
+ % Analoges gilt fuer stopRegForObjClass()
+
+ % Subscribe Trl
+ subscribeInteractClass(HLA.RttTrl);
+ % --> receiveInteract()
+return
+
+
+%---------------------------------------------------------------
+function startRegForObjClass(theClass)
+%Invoked by RTI to inform the federate that other federates have subscribed
+%to a published object class.
+
+disp('(car_ts) startRegForObjClass>> ... no operation');
+
+return
+
+
+%---------------------------------------------------------------
+function stopRegForObjClass(theClass)
+%Invoked by RTI to inform the federate that no longer any other federate
+%have subscribed a published object class.
+
+disp('(car_ts) stopRegForObjClass>> ... no operation');
+
+return
+
+
+%---------------------------------------------------------------
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%Invoked by RTI to tell the federate interactions sent from remote federates.
+
+if (nargin == 5)
+ % treatment of receiveInteract(5 input param) is not needed;
+ % instead default implementation
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+
+ cmd='';
+
+ while ~strcmp(cmd,'return')
+ cmd = input('(car_ts) receiveInteract(5 arg var)>> ','s');
+ eval(cmd,'error_handler')
+ end
+
+else
+ % receiveInteract(3 input param) is used and implemented here
+ theTag = in3;
+ clear in3
+
+ global HLA
+
+ %DEBUG
+ disp(['receive ' theTag])
+ global LOG
+ fprintf(LOG,'%s\n',['receive ' theTag]);
+
+ if theInteraction == HLA.RttTrl
+ event = net2char(theParameters{2});
+ car_ts('barrier_Callback', event)
+ else
+ error('receiveInteract failed: unknown InteractClass')
+ end
+
+end
+
+return
+
+
+%---------------------------------------------------------------
+function loop
+%car_ts loop
+
+global T
+
+ while ~T.Terminate % simulation loop
+
+ [trash,e] = tick(0.3,0.3); if ~isempty(e), error(e), end
+
+ car_ts('generate')
+
+ car_ts('move')
+
+ car_ts('destroy')
+
+ car_ts('time_step')
+
+ if T.Continue == 0
+ while T.Continue == 0
+ drawnow % stop
+ end
+ elseif T.Continue == -1
+ T.Continue = 0;
+ while T.Continue == 0
+ drawnow % step
+ end
+ end
+ end
+return
+
+
+%------------------------------------------------------------------
+function generate
+%Creates new cars
+
+global Cars
+
+ full = 0;
+ if ~isempty(Cars.Lhdl)
+ if Cars.Pos(1) == 0
+ full = 1;
+ end
+ end
+
+ if ~full & rand > 0.9
+ lhdl = Cars.NextLhdl;
+ pos = 0;
+ ghdl = car_ts('generate_anim', lhdl);
+ hhdl = car_ts('hla_register', lhdl);
+
+ Cars.Lhdl = [lhdl Cars.Lhdl];
+ Cars.Pos = [pos Cars.Pos ];
+ Cars.Ghdl = [ghdl Cars.Ghdl];
+ Cars.Hhdl = [hhdl Cars.Hhdl];
+
+ Cars.NextLhdl = Cars.NextLhdl + 1;
+ end
+return
+
+
+%-----------------------------------------------------------
+function ghdl = generate_anim(lhdl)
+%Animates creation of new cars
+
+ x = 0; y = 10;
+ xl = 0.4; yl = 0.4;
+
+ ghdl = patch([x-xl,x-xl,x+xl,x+xl],...
+ [y-yl,y+yl,y+yl,y-yl],...
+ 'g');
+
+ text_ghdl = text(x,y,int2str(lhdl),'HorizontalAlignment','center');
+
+ set(ghdl,'UserData',text_ghdl)
+
+ drawnow
+return
+
+
+%-----------------------------------------------------------
+function hhdl = hla_register(lhdl)
+%hla_register HLA: neues Auto registrieren
+
+global HLA
+
+ %DEBUG
+ disp(['register car' int2str(lhdl) ])
+ global LOG
+ fprintf(LOG,'%s\n',['register car' int2str(lhdl) ]);
+
+ hhdl = registerObjInst(HLA.RttCar, int2str(lhdl) );
+
+return
+
+
+%-----------------------------------------------------------
+function move
+%Moves cars
+
+global Cars
+
+ idx = find( Cars.Pos(:) >= Cars.Barrier ); % cars upon or behind
barr.
+ if ~isempty(idx)
+ Cars.Pos(idx) = Cars.Pos(idx) + 1;
+
+ car_ts('move_anim', Cars.Ghdl(idx) );
+
+ car_ts('hla_update', Cars.Hhdl(idx), ...
+ Cars.Pos(idx), ...
+ Cars.Lhdl(idx) );
+ end
+
+ idx = find( Cars.Pos(:) < Cars.Barrier ); % cars in front of barrier
+ if ~isempty(idx)
+ if Cars.Pos(idx(end)) < Cars.Barrier-1 % car next to barrier
+ Cars.Pos(idx(end)) = Cars.Pos(idx(end)) + 1;
+
+ car_ts('move_anim', Cars.Ghdl(idx(end)) );
+
+ car_ts('hla_update', Cars.Hhdl(idx(end)), ...
+ Cars.Pos(idx(end)), ...
+ Cars.Lhdl(idx(end)) );
+ end
+ end
+ for i=1:length(idx)-1 % rest of cars
+ if Cars.Pos(i) < Cars.Pos(i+1)-1
+ Cars.Pos(i) = Cars.Pos(i) + 1;
+
+ car_ts('move_anim', Cars.Ghdl(i) );
+
+ car_ts('hla_update', Cars.Hhdl(i), ...
+ Cars.Pos(i), ...
+ Cars.Lhdl(i) );
+ end
+ end
+
+
+%--------------------------------------------------------------------
+function move_anim(ghdl)
+%Animates moving cars
+%
+% move_anim(ghdl,delta_x) ghdl may be a vector
+
+ for i=ghdl
+ set(i,'XDATA', ...
+ get(i,'XDATA') ...
+ + 1 )
+
+ text_ghdl = get(i,'UserData');
+ pos = get(text_ghdl,'Position');
+ pos(1) = pos(1) + 1;
+ set(text_ghdl,'Position',pos);
+ end
+
+ drawnow
+return
+
+
+%--------------------------------------------------------------------
+function hla_update(hhdl,pos,lhdl)
+%hla_update
+
+global HLA
+
+ for i=1:length(hhdl)
+
+ tag = ['car' int2str(lhdl(i))];
+
+ %DEBUG
+ disp(['update ' tag])
+ global LOG
+ fprintf(LOG,'%s\n',['update ' tag]);
+
+ updateAttrVal( hhdl(i), ...
+ {HLA.RttCarPos, double2net(pos(i))}, ...
+ tag);
+ end
+return
+
+
+%--------------------------------------------------------------------
+function destroy
+%Destroys cars
+
+global Cars
+
+ if ~isempty(Cars.Lhdl)
+ if Cars.Pos(end) > 20
+ car_ts('hla_delete', Cars.Hhdl(end), Cars.Lhdl(end));
+
+ car_ts('destroy_anim', Cars.Ghdl(end) )
+
+ Cars.Lhdl = Cars.Lhdl(1:end-1);
+ Cars.Pos = Cars.Pos(1:end-1);
+ Cars.Ghdl = Cars.Ghdl(1:end-1);
+ Cars.Hhdl = Cars.Hhdl(1:end-1);
+ end
+ end
+return
+
+
+%----------------------------------------------------------------
+function destroy_anim(ghdl)
+%Animates destroying cars
+
+ text_ghdl = get(ghdl,'UserData');
+
+ delete(text_ghdl)
+
+ delete(ghdl)
+
+ drawnow
+return
+
+
+%-------------------------------------------------------------
+function hla_delete(hhdl,lhdl)
+%hla_delete HLA: delete object instance
+
+ tag = ['car' int2str(lhdl)];
+
+ %DEBUG
+ disp(['delete ' tag]);
+ global LOG
+ fprintf(LOG,'%s\n',['delete ' tag]);
+
+ deleteObjInst(hhdl,tag);
+return
+
+
+%-------------------------------------------------------------
+function time_step
+%Increase simulation time
+
+global T
+
+
+ T.Current = T.Current + T.Step;
+
+% fprintf('t = %d\n',T.Current)
+
+ car_ts('time_step_anim', T.Current);
+return
+
+
+%-------------------------------------------------------------
+function time_step_anim( t_current )
+%Animates increasing simulation time
+
+global Ghdl
+
+ set(Ghdl.TCurrent,'String',['t = ' int2str(t_current)])
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_leave
+%Leave HLA
+
+ % Resign federation
+ % Aufruf mit Argument: DELETE OBJECTS, weil die Autos, die sich bei
+ % Simulationsabbruch auf der Strasse befinden nicht durch
+ % destroy_car->hla_delete->deleteObjInst geloescht werden.
+ e = resignFedExec('d');
+ if ~isempty(e)
+ error(['resignFedExec failed: ' e])
+ end
+return
+
+
+%---------------------------------------------------------------
+function hla_down
+%Destroy federation Traffic-Distr1 and disconnect from RTI
+
+ % Destroy federation
+ e = destroyFedExec('Traffic-Distr1');
+ if ~isempty(e) & ~strcmp(e,'FederatesCurrentlyJoined')
+ error(['destroyFedExec failed: ' e])
+ end
+
+ % Disconnect from RTI
+ rtiOff
+return
+
+
Index: demo/Traffic-Distr1/car_ts/receiveInteract.m
===================================================================
RCS file: demo/Traffic-Distr1/car_ts/receiveInteract.m
diff -N demo/Traffic-Distr1/car_ts/receiveInteract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/car_ts/receiveInteract.m 28 Jan 2008 21:46:18
-0000 1.1
@@ -0,0 +1,79 @@
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%receiveInteract Receive Interactions (rti initiated).
+%
+%Synopsis:
+% receiveInteract(theInteraction,theParameters,theTime,theTag,theHandle)
+% receiveInteract(theInteraction,theParameters,theTag)
+%
+%Purpose:
+% Receive interactions sent from remote federates.
+
+% throw ( first method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if (nargin == 5)
+ car_ts('receiveInteract', ...
+ theInteraction, theParameters, in3, in4, in5)
+else
+ car_ts('receiveInteract', ...
+ theInteraction, theParameters, in3)
+end
+
+return
+
+
+%---------------------------------------------------------------
+%------------------------- default impl. ------------------------
+if (nargin == 5)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) receiveInteract>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
Index: demo/Traffic-Distr1/car_ts/stopRegForObjClass.m
===================================================================
RCS file: demo/Traffic-Distr1/car_ts/stopRegForObjClass.m
diff -N demo/Traffic-Distr1/car_ts/stopRegForObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/car_ts/stopRegForObjClass.m 28 Jan 2008 21:46:19
-0000 1.1
@@ -0,0 +1,57 @@
+function stopRegForObjClass(theClass)
+%stopRegForObjClass Stop Registration for Object Class (rti initiated).
+%
+%Synopsis:
+% stopRegForObjClass(theClass)
+%
+%Purpose:
+% To inform the federate that no other federates in the federation
+% execution are subscribed to an object class that it has published.
+
+% throw (
+% ObjectClassNotPublished,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+car_ts('stopRegForObjClass', theClass)
+
+return
+
+
+%-------------------- default impl. -------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) stopRegForObjClass>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
+
Index: demo/Traffic-Distr1/car_ts/startRegForObjClass.m
===================================================================
RCS file: demo/Traffic-Distr1/car_ts/startRegForObjClass.m
diff -N demo/Traffic-Distr1/car_ts/startRegForObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/car_ts/startRegForObjClass.m 28 Jan 2008 21:46:19
-0000 1.1
@@ -0,0 +1,55 @@
+function startRegForObjClass(theClass)
+%startRegForObjClass Start Registration for Object Class (rti initiated).
+%
+%Synopsis:
+% startRegForObjClass(theClass)
+%
+%Purpose:
+% To inform the federate that other federates in the federation
+% execution have subscribed to an object class that it has
+% published.
+
+% throw (
+% ObjectClassNotPublished,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+car_ts('startRegForObjClass', theClass)
+
+return
+
+
+%-------------------- default impl. -------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) startRegForObjClass>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
Index: COPYING
===================================================================
RCS file: COPYING
diff -N COPYING
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ COPYING 28 Jan 2008 21:46:19 -0000 1.1
@@ -0,0 +1,33 @@
+MatlabHLA13
+
+All components of MatlabHLA13 are free software; you can redistribute
+it and/or modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation. You should have
+received a copy of the GNU LGPL with this program, in the file "lesser.txt".
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program, in the file "lesser.txt"; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA
+
+Demo and test applications
+
+All content of demo and test directories are free software; you can
+redistribute it and/or modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation. You should have
+received a copy of the GNU with this program, in the file "gpl.txt".
+
+These programs are distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program, in the file "gpl.txt"; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA
Index: README
===================================================================
RCS file: README
diff -N README
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ README 28 Jan 2008 21:46:19 -0000 1.1
@@ -0,0 +1,28 @@
+#############################
+# Copyright and license #
+#############################
+
+Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+MatlabHLA13 is licenced under the conditions of the LGPL, see lesser.txt
+for additional information.
+
+All demo and test applications are licensed under the conditions of the GPL,
+see gpl.txt for additional information.
+
+The MatlabHLA13 toolbox was delevoped on top of CERTI (www.cert.fr/CERTI).
+This is the preferred RTI.
+
+#############################
+# Compiling/Installation #
+#############################
+
+After installing CERTI do make && make install. After that rti.mexglx is
+compiled and all m-files are copied to the MatlabHLA13 directory.
+
+It is recommended to copy the FED files in the federation directory manually
+to /usr/local/share/federations.
+
+To use the toolbox properly add the MatlabHLA13 directory to your Matlab path.
+
+15.01.2008, C. Stenzel
Index: 00Content.txt
===================================================================
RCS file: 00Content.txt
diff -N 00Content.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 00Content.txt 28 Jan 2008 21:46:19 -0000 1.1
@@ -0,0 +1,154 @@
+directory content
+
+00Changes.txt
+00Content.txt
+COPYING
+demo
+ Traffic-Distr1
+ car_ts
+ car_ts.m
+ receiveInteract.m
+ startRegForObjClass.m
+ stopRegForObjClass.m
+ Contents.m
+ observ
+ discoverObjInst.m
+ observ.m
+ receiveInteract.m
+ reflectAttrVal.m
+ removeObjInst.m
+ ped_ts
+ ped_ts.m
+ receiveInteract.m
+ startRegForObjClass.m
+ stopRegForObjClass.m
+ TrafficDistr1.fed
+ trl_rt
+ trl_rt.m
+ turnInteractOff.m
+ turnInteractOn.m
+ TwoLevelController
+ controlFed_woTime
+ controlFed.m
+ discoverObjInst.m
+ reflectAttrVal.m
+ controlFed_wTime
+ controlFed.m
+ discoverObjInst.m
+ reflectAttrVal.m
+ timeAdvGrant.m
+ processFed_woTime
+ discoverObjInst.m
+ processFed.m
+ reflectAttrVal.m
+ processFed_wTime
+ discoverObjInst.m
+ processFed.m
+ reflectAttrVal.m
+ timeAdvGrant.m
+ TwoLevelController.fed
+federations
+ TrafficDistr1.fed
+ TwoLevelController.fed
+gpl.txt
+lesser.txt
+Makefile
+m_files
+ announceSyncPoint.m
+ attrInScope.m
+ attrOutOfScope.m
+ changeAttrOrderType.m
+ changeAttrTransType.m
+ changeInteractOrderType.m
+ changeInteractTransType.m
+ char2net.m
+ Contents.m
+ createFedExec.m
+ deleteObjInst.m
+ destroyFedExec.m
+ disableAsyncDeliv.m
+ disableTimeConstr.m
+ disableTimeReg.m
+ discoverObjInst.m
+ double2net.m
+ enableAsyncDeliv.m
+ enableAttrRelAdvisSwitch.m
+ enableTimeConstr.m
+ enableTimeReg.m
+ federateResComplete.m
+ federateResNotComplete.m
+ federateSaveBegun.m
+ federateSaveComplete.m
+ federateSaveNotComplete.m
+ fedNotRestored.m
+ fedNotSaved.m
+ fedResBegun.m
+ fedRestored.m
+ fedSaved.m
+ fedSync.m
+ flushQueueReq.m
+ getAttrHdl.m
+ getEpsilon.m
+ getInteractClassHdl.m
+ getObjClassHdl.m
+ getOrderingHdl.m
+ getParamHdl.m
+ getTransHdl.m
+ initiateFedRestore.m
+ initiateFedSave.m
+ joinFedExec.m
+ localDelObjInst.m
+ modifyLookahead.m
+ net2char.m
+ net2double.m
+ nextEventReqAvail.m
+ nextEventReq.m
+ provideAttrValUpdate.m
+ publishInteractClass.m
+ publishObjClass.m
+ queryFedTime.m
+ queryLBTS.m
+ queryLookahead.m
+ queryMinNextEventTime.m
+ receiveInteract.m
+ reflectAttrVal.m
+ registerFedSyncPoint.m
+ registerObjInst.m
+ removeObjInst.m
+ requestClassAttrValUp.m
+ requestFedResFailed.m
+ requestFedResSuccess.m
+ requestFedRestore.m
+ requestFedSave.m
+ requestObjAttrValUp.m
+ requestRetract.m
+ resignFedExec.m
+ retract.m
+ rtiOff.m
+ rtiOn.m
+ sendInteract.m
+ startRegForObjClass.m
+ stopRegForObjClass.m
+ subscribeInteractClass.m
+ subscribeObjClassAttr.m
+ synchronizationPointAchieved.m
+ syncPointRegFailed.m
+ syncPointRegSuccess.m
+ tick.m
+ timeAdvGrant.m
+ timeAdvReqAvail.m
+ timeAdvReq.m
+ timeConstrEnabled.m
+ timeRegEnabled.m
+ turnInteractOff.m
+ turnInteractOn.m
+ turnUpdatesOffForObjInst.m
+ turnUpdatesOnForObjInst.m
+ unpublishInteractClass.m
+ unpublishObjClass.m
+ unsubscribeInteractClass.m
+ unsubscribeObjClass.m
+ updateAttrVal.m
+README
+rti
+ rti.cpp
Index: 00Changes.txt
===================================================================
RCS file: 00Changes.txt
diff -N 00Changes.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 00Changes.txt 28 Jan 2008 21:46:19 -0000 1.1
@@ -0,0 +1,5 @@
+###############################################################################
+# 15.01.2008 #
+###############################################################################
+
+Version 0.5 of MatlabHLA13
Index: gpl.txt
===================================================================
RCS file: gpl.txt
diff -N gpl.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gpl.txt 28 Jan 2008 21:46:19 -0000 1.1
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: Makefile
===================================================================
RCS file: Makefile
diff -N Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Makefile 28 Jan 2008 21:46:20 -0000 1.1
@@ -0,0 +1,40 @@
+# Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+#
+# This file is part of MatlabHLA13.
+#
+# MatlabHLA13 is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation, either
+# version 3 of the License, or (at your option) any later version.
+#
+# MatlabHLA13 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with MatlabHLA13.
+#
+# If not, see <http://www.gnu.org/licenses/>.
+
+# debug output enabled
+FLAGS = -v -DRTI_USES_STD_FSTREAM -D_GNU_SOURCE
+
+VERSION = 0.5
+MEXSUFFIX = mexglx
+TARGETDIR = MatlabHLA13_v${VERSION}
+
+BINS = rti.${MEXSUFFIX}
+
+all: ${BINS}
+
+rti.${MEXSUFFIX}: rti/rti.cpp
+ mex ${FLAGS} -o $@ $^ -lRTI
+
+install:
+ mkdir ./${TARGETDIR}; \
+ cp rti.${MEXSUFFIX} ${TARGETDIR}
+ cp m_files/* ${TARGETDIR}
+
+clean:
+ rm rti.${MEXSUFFIX}
Index: lesser.txt
===================================================================
RCS file: lesser.txt
diff -N lesser.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lesser.txt 28 Jan 2008 21:46:20 -0000 1.1
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Index: federations/TrafficDistr1.fed
===================================================================
RCS file: federations/TrafficDistr1.fed
diff -N federations/TrafficDistr1.fed
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ federations/TrafficDistr1.fed 28 Jan 2008 21:46:20 -0000 1.1
@@ -0,0 +1,243 @@
+;; Copyright (c) 1998-2000 University of Rostock, Germany,
+;; Institute of Automatic Control. All rights reserved.
+;; Author: S. Pawletta
+;;
+;; This file is part of MatlabHLA13 demo applications.
+;;
+;; This demo is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public
+;; License as published by the Free Software Foundation, either
+;; version 3 of the License, or (at your option) any later version.
+;;
+;; This demo is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public
+;; License along with this demo.
+;;
+;; If not, see <http://www.gnu.org/licenses/>.
+
+;; changed C.Stentel, 14.01.2008, Changed federation name)
+(FED
+ (Federation TrafficDistr1)
+ (FEDversion v1_3)
+ (spaces
+ )
+ (objects
+ (class objectRoot
+ (attribute privilegeToDelete reliable timestamp)
+ (class RTIprivate)
+ (class Manager
+ (class Federate
+ (attribute FederateHandle best_effort receive)
+ (attribute FederateType best_effort receive)
+ (attribute FederateHost best_effort receive)
+ (attribute RTIversion best_effort receive)
+ (attribute FEDid best_effort receive)
+ (attribute TimeConstrained best_effort receive)
+ (attribute TimeRegulating best_effort receive)
+ (attribute AsynchronousDelivery best_effort receive)
+ (attribute FederateState best_effort receive)
+ (attribute TimeManagerState best_effort receive)
+ (attribute FederateTime best_effort receive)
+ (attribute Lookahead best_effort receive)
+ (attribute LBTS best_effort receive)
+ (attribute MinNextEventTime best_effort receive)
+ (attribute ROlength best_effort receive)
+ (attribute TSOlength best_effort receive)
+ (attribute ReflectionsReceived best_effort receive)
+ (attribute UpdatesSent best_effort receive)
+ (attribute InteractionsReceived best_effort receive)
+ (attribute InteractionsSent best_effort receive)
+ (attribute ObjectsOwned best_effort receive)
+ (attribute ObjectsUpdated best_effort receive)
+ (attribute ObjectsReflected best_effort receive) )
+ (class Federation
+ (attribute FederationName best_effort receive)
+ (attribute FederatesInFederation best_effort receive)
+ (attribute RTIversion best_effort receive)
+ (attribute FEDid best_effort receive)
+ (attribute LastSaveName best_effort receive)
+ (attribute LastSaveTime best_effort receive)
+ (attribute NextSaveName best_effort receive)
+ (attribute NextSaveTime best_effort receive) )
+ )
+;; user object classes here
+ (class Car
+ (attribute Pos reliable timestamp)
+ )
+ (class Ped
+ (attribute Pos reliable timestamp)
+ )
+ )
+ )
+ (interactions
+ (class interactionRoot best_effort receive
+ (class RTIprivate best_effort receive)
+ (class Manager best_effort receive
+ (class Federate best_effort receive
+ (parameter Federate)
+ (class Adjust best_effort receive
+ (class SetTiming best_effort receive
+ (parameter ReportPeriod) )
+ (class ModifyAttributeState best_effort receive
+ (parameter ObjectInstance)
+ (parameter Attribute)
+ (parameter AttributeState) )
+ (class SetServiceReporting best_effort receive
+ (parameter ReportingState) )
+ (class SetExceptionLogging best_effort receive
+ (parameter LoggingState) )
+ )
+ (class Request best_effort receive
+ (class RequestPublications best_effort receive)
+ (class RequestSubscriptions best_effort receive)
+ (class RequestObjectsOwned best_effort receive)
+ (class RequestObjectsUpdated best_effort receive)
+ (class RequestObjectsReflected best_effort receive)
+ (class RequestUpdatesSent best_effort receive)
+ (class RequestInteractionsSent best_effort receive)
+ (class RequestReflectionsReceived best_effort receive)
+ (class RequestInteractionsReceived best_effort receive)
+ (class RequestObjectInformation best_effort receive
+ (parameter ObjectInstance) )
+ )
+ (class Report best_effort receive
+ (class ReportObjectPublication best_effort receive
+ (parameter NumberOfClasses)
+ (parameter ObjectClass)
+ (parameter AttributeList) )
+ (class ReportInteractionPublication best_effort receive
+ (parameter InteractionClassList) )
+ (class ReportObjectSubscription best_effort receive
+ (parameter NumberOfClasses)
+ (parameter ObjectClass)
+ (parameter AttributeList)
+ (parameter Active) )
+ (class ReportInteractionSubscription best_effort receive
+ (parameter InteractionClassList) )
+ (class ReportObjectsOwned best_effort receive
+ (parameter ObjectCounts) )
+ (class ReportObjectsUpdated best_effort receive
+ (parameter ObjectCounts) )
+ (class ReportObjectsReflected best_effort receive
+ (parameter ObjectCounts) )
+ (class ReportUpdatesSent best_effort receive
+ (parameter TransportationType)
+ (parameter UpdateCounts) )
+ (class ReportReflectionsReceived best_effort receive
+ (parameter TransportationType)
+ (parameter ReflectCounts) )
+ (class ReportInteractionsSent best_effort receive
+ (parameter TransportationType)
+ (parameter InteractionCounts) )
+ (class ReportInteractionsReceived best_effort receive
+ (parameter TransportationType)
+ (parameter InteractionCounts) )
+ (class ReportObjectInformation best_effort receive
+ (parameter ObjectInstance)
+ (parameter OwnedAttributeList)
+ (parameter RegisteredClass)
+ (parameter KnownClass) )
+ (class Alert best_effort receive
+ (parameter AlertSeverity)
+ (parameter AlertDescription)
+ (parameter AlertID) )
+ (class ReportServiceInvocation best_effort receive
+ (parameter Service)
+ (parameter Initiator)
+ (parameter SuccessIndicator)
+ (parameter SuppliedArgument1)
+ (parameter SuppliedArgument2)
+ (parameter SuppliedArgument3)
+ (parameter SuppliedArgument4)
+ (parameter SuppliedArgument5)
+ (parameter ReturnedArgument)
+ (parameter ExceptionDescription)
+ (parameter ExceptionID) )
+ )
+ (class Service best_effort receive
+ (class ResignFederationExecution best_effort receive
+ (parameter ResignAction) )
+ (class SynchronizationPointAchieved best_effort receive
+ (parameter Label) )
+ (class FederateSaveBegun best_effort receive)
+ (class FederateSaveComplete best_effort receive
+ (parameter SuccessIndicator) )
+ (class FederateRestoreComplete best_effort receive
+ (parameter SuccessIndicator) )
+ (class PublishObjectClass best_effort receive
+ (parameter ObjectClass)
+ (parameter AttributeList) )
+ (class UnpublishObjectClass best_effort receive
+ (parameter ObjectClass) )
+ (class PublishInteractionClass best_effort receive
+ (parameter InteractionClass) )
+ (class UnpublishInteractionClass best_effort receive
+ (parameter InteractionClass) )
+ (class SubscribeObjectClassAttributes best_effort receive
+ (parameter ObjectClass)
+ (parameter AttributeList)
+ (parameter Active) )
+ (class UnsubscribeObjectClass best_effort receive
+ (parameter ObjectClass) )
+ (class SubscribeInteractionClass best_effort receive
+ (parameter InteractionClass)
+ (parameter Active) )
+ (class UnsubscribeInteractionClass best_effort receive
+ (parameter InteractionClass) )
+ (class DeleteObjectInstance best_effort receive
+ (parameter ObjectInstance)
+ (parameter FederationTime)
+ (parameter Tag) )
+ (class LocalDeleteObjectInstance best_effort receive
+ (parameter ObjectInstance) )
+ (class ChangeAttributeTransportationType best_effort receive
+ (parameter ObjectInstance)
+ (parameter AttributeList)
+ (parameter TransportationType) )
+ (class ChangeAttributeOrderType best_effort receive
+ (parameter ObjectInstance)
+ (parameter AttributeList)
+ (parameter OrderingType) )
+ (class ChangeInteractionTransportationType best_effort receive
+ (parameter InteractionClass)
+ (parameter TransportationType) )
+ (class ChangeInteractionOrderType best_effort receive
+ (parameter InteractionClass)
+ (parameter OrderingType) )
+ (class UnconditionalAttributeOwnershipDivestiture best_effort
receive
+ (parameter ObjectInstance)
+ (parameter AttributeList) )
+ (class EnableTimeRegulation best_effort receive
+ (parameter FederationTime)
+ (parameter Lookahead) )
+ (class DisableTimeRegulation best_effort receive)
+ (class EnableTimeConstrained best_effort receive)
+ (class DisableTimeConstrained best_effort receive)
+ (class EnableAsynchronousDelivery best_effort receive)
+ (class DisableAsynchronousDelivery best_effort receive)
+ (class ModifyLookahead best_effort receive
+ (parameter Lookahead) )
+ (class TimeAdvanceRequest best_effort receive
+ (parameter FederationTime) )
+ (class TimeAdvanceRequestAvailable best_effort receive
+ (parameter FederationTime) )
+ (class NextEventRequest best_effort receive
+ (parameter FederationTime) )
+ (class NextEventRequestAvailable best_effort receive
+ (parameter FederationTime) )
+ (class FlushQueueRequest best_effort receive
+ (parameter FederationTime) )
+ )
+ )
+ )
+;; user interaction classes here
+ (class Trl reliable timestamp
+ (parameter Event)
+ )
+ )
+ )
+)
Index: federations/TwoLevelController.fed
===================================================================
RCS file: federations/TwoLevelController.fed
diff -N federations/TwoLevelController.fed
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ federations/TwoLevelController.fed 28 Jan 2008 21:46:20 -0000 1.1
@@ -0,0 +1,44 @@
+;; Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+;;
+;; This file is part of MatlabHLA13 demo applications.
+;;
+;; This demo is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public
+;; License as published by the Free Software Foundation, either
+;; version 3 of the License, or (at your option) any later version.
+;;
+;; This demo is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public
+;; License along with this demo.
+;;
+;; If not, see <http://www.gnu.org/licenses/>.
+
+;; TwoLevelController
+
+(Fed
+ (Federation TwoLevelController)
+ (FedVersion v1.3)
+ (Federate "controlFed" "Public")
+ (Federate "processFed" "Public")
+ (Spaces
+ )
+ (Objects
+ (Class ObjectRoot
+ (Attribute privilegeToDelete reliable timestamp)
+ (Class RTIprivate)
+ (Class TwoLevelControllerClass
+ (Attribute U RELIABLE TIMESTAMP)
+ (Attribute Y RELIABLE TIMESTAMP)
+ )
+ )
+ )
+ (Interactions
+ (Class InteractionRoot BEST_EFFORT RECEIVE
+ (Class RTIprivate BEST_EFFORT RECEIVE)
+ )
+ )
+)
Index: demo/TwoLevelController/controlFed_wTime/discoverObjInst.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_wTime/discoverObjInst.m
diff -N demo/TwoLevelController/controlFed_wTime/discoverObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_wTime/discoverObjInst.m 28 Jan 2008
21:46:20 -0000 1.1
@@ -0,0 +1,54 @@
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%discoverObjInst Discover Object Instance (rti initiated).
+%
+%Synopsis:
+% discoverObjInst(theObject, theObjectClass, theObjectName)
+%
+%Purpose:
+% Allows a federate to discover other objects that exist
+% in remote federates.
+
+% throw (
+% CouldNotDiscover,
+% ObjectClassNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global discoverY
+
+discoverY = true;
+
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) discoverObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/controlFed_wTime/timeAdvGrant.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_wTime/timeAdvGrant.m
diff -N demo/TwoLevelController/controlFed_wTime/timeAdvGrant.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_wTime/timeAdvGrant.m 28 Jan 2008
21:46:21 -0000 1.1
@@ -0,0 +1,54 @@
+function timeAdvGrant(theTime)
+%timeAdvGrant Time Advance Grant (rti initiated).
+%
+%Synopsis:
+% timeAdvGrant(theTime)
+%
+%Purpose:
+% Informs me of the current time value I have been advanced to.
+% This is in response to one of the time advance sercices.
+
+% throw (
+% InvalidFederationTime,
+% TimeAdvanceWasNotInProgress,
+% FederationTimeAlreadyPassed,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global newTimeStep
+
+newTimeStep = true;
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) timeAdvGrant>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/controlFed_wTime/reflectAttrVal.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_wTime/reflectAttrVal.m
diff -N demo/TwoLevelController/controlFed_wTime/reflectAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_wTime/reflectAttrVal.m 28 Jan 2008
21:46:21 -0000 1.1
@@ -0,0 +1,72 @@
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%reflectAttrVal Reflect Attribute Values (rti initiated).
+%
+%Synopsis:
+% reflectAttrVal(theObject,theAttributes,theTime,theTag,theHandle)
+% reflectAttrVal(theObject,theAttributes,theTag)
+%
+%Purpose:
+% Receive updates from the RTI of attributes that belong to
+% object class instances.
+
+% throw ( first method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global y
+
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+y = net2double( theAttributes{1,2} );
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) reflectAttrVal>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/controlFed_wTime/controlFed.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_wTime/controlFed.m
diff -N demo/TwoLevelController/controlFed_wTime/controlFed.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_wTime/controlFed.m 28 Jan 2008
21:46:21 -0000 1.1
@@ -0,0 +1,156 @@
+% control federate
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+rtiOn;
+
+federationName = 'TwoLevelController';
+federateName = 'controlFed';
+fedFile = 'TwoLevelController.fed'
+
+disp('Create federation execution ....')
+
+e = createFedExec(federationName, fedFile)
+
+switch e
+ case ''
+ disp('created.');
+ case 'FederationExecutionAlreadyExists'
+ disp('already created.');
+ otherwise
+ error(['createFedExec failed: ' e])
+end
+
+disp('Join federation execution ...')
+
+[federateId, e] = joinFedExec( federateName, federationName);
+
+if isempty(e)
+ disp('joined.')
+else
+ error(['joinFedExec failed: ' e])
+end
+
+
+% get handles
+
+twoLevelContrID = getObjClassHdl('TwoLevelControllerClass')
+uID = getAttrHdl('U', twoLevelContrID)
+yID = getAttrHdl('Y', twoLevelContrID)
+
+subscribeObjClassAttr( twoLevelContrID, yID);
+publishObjClass(twoLevelContrID, uID);
+
+objInstID_u = registerObjInst(twoLevelContrID, 'u')
+
+tEnd = 30;
+tStart = 0;
+h = 0.1;
+w = 0.5;
+K = 1;
+T1 = 5;
+
+tSim = tStart;
+u = 1;
+
+global y
+y = 0;
+
+global discoverY
+discoverY = false
+
+global newTimeStep
+newTimeStep = false
+
+disp('Init time management features.')
+
+e = enableTimeConstr
+e = enableTimeReg(tStart, h)
+
+e = enableAsyncDeliv
+
+tFed = queryFedTime()
+
+disp('Wait for y')
+while ~discoverY
+ tick;
+ pause(0.5)
+end
+discoverY = false;
+disp('Got y')
+
+
+while ( tSim-tEnd <= 0 )
+
+ tick;
+ pause(0.001);
+
+ if (y < w-0.1 ), u=1; end
+ if (y > w+0.1 ), u=0; end
+
+ attrHdlSet = {uID, double2net(u)};
+
+ updateAttrVal(objInstID_u, attrHdlSet, tSim+h, 'u');
+
+ y
+ u
+ tSim = tSim + h
+
+ timeAdvReq(tSim);
+ while ~newTimeStep
+ tick;
+ pause(0.001)
+ end
+ newTimeStep = false;
+
+end
+
+disp('Resign Federation execution ... ')
+
+e = resignFedExec('dr');
+
+if isempty(e)
+ disp('resigned.');
+else
+ error(['resignFedExec failed: ' e])
+end
+
+
+disp('Destroy federation execution ... ');
+
+disp('Hit key to resume in creator of federation')
+pause
+
+e = destroyFedExec(federationName)
+
+switch e
+ case ''
+ disp('destroyed.');
+ case 'FederatesCurrentlyJoined'
+ disp('other federates still joined.');
+ case 'FederationExecutionDoesNotExist'
+ disp('Federation already destroyed.')
+ otherwise
+ rtiOff
+ error(['destroyFedExec: ' e])
+end
+
+rtiOff
+
Index: demo/TwoLevelController/processFed_woTime/processFed.m
===================================================================
RCS file: demo/TwoLevelController/processFed_woTime/processFed.m
diff -N demo/TwoLevelController/processFed_woTime/processFed.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_woTime/processFed.m 28 Jan 2008
21:46:21 -0000 1.1
@@ -0,0 +1,145 @@
+% process federate
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+rtiOn;
+
+federationName = 'TwoLevelController';
+federateName = 'processFed';
+fedFile = 'TwoLevelController.fed'
+
+disp('Create federation execution ....')
+
+e = createFedExec(federationName, fedFile)
+
+switch e
+ case ''
+ disp('created.');
+ case 'FederationExecutionAlreadyExists'
+ disp('already created.');
+ otherwise
+ error(['createFedExec failed: ' e])
+end
+
+disp('Join federation execution ...')
+
+[federateId, e] = joinFedExec( federateName, federationName);
+
+if isempty(e)
+ disp('joined.')
+else
+ error(['joinFedExec failed: ' e])
+end
+
+
+% get handles
+
+twoLevelContrID = getObjClassHdl('TwoLevelControllerClass')
+uID = getAttrHdl('U', twoLevelContrID)
+yID = getAttrHdl('Y', twoLevelContrID)
+
+subscribeObjClassAttr( twoLevelContrID, uID)
+publishObjClass(twoLevelContrID, yID)
+
+objInstID_y = registerObjInst(twoLevelContrID, 'y')
+
+tEnd = 30;
+tStart = 0;
+h = 0.1;
+w = 0.5;
+K = 1;
+T1 = 5;
+
+tSim = tStart;
+y = 0;
+ydot = 0;
+
+global newU
+newU = false;
+
+global u
+u = 1;
+
+global discoverU
+discoverU = false
+
+disp('Wait for u')
+while ~discoverU
+ tick;
+ pause(0.5);
+end
+discoverU = false;
+disp('Got u')
+
+while ( tSim-tEnd <= 0 )
+
+ while ~newU
+ tick;
+ pause(0.001);
+ end
+ newU = false;
+
+ tick;
+ pause(0.001);
+
+ ydot = ( -y + u*K ) / T1;
+ y = y + h*ydot;
+
+ attrHdlSet = {yID, double2net(y)};
+
+ updateAttrVal(objInstID_y, attrHdlSet, 'y');
+
+ y
+ u
+
+ tSim = tSim + h
+end
+
+disp('Resign Federation execution ... ')
+
+e = resignFedExec('dr');
+
+if isempty(e)
+ disp('resigned.');
+else
+ error(['resignFedExec failed: ' e])
+end
+
+
+disp('Destroy federation execution ... ');
+
+disp('Hit key to resume in creator of federation')
+pause
+
+e = destroyFedExec(federationName)
+
+switch e
+ case ''
+ disp('destroyed.');
+ case 'FederatesCurrentlyJoined'
+ disp('other federates still joined.');
+ case 'FederationExecutionDoesNotExist'
+ disp('Federation already destroyed.')
+ otherwise
+ rtiOff
+ error(['destroyFedExec: ' e])
+end
+
+rtiOff
Index: demo/TwoLevelController/processFed_woTime/discoverObjInst.m
===================================================================
RCS file: demo/TwoLevelController/processFed_woTime/discoverObjInst.m
diff -N demo/TwoLevelController/processFed_woTime/discoverObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_woTime/discoverObjInst.m 28 Jan 2008
21:46:21 -0000 1.1
@@ -0,0 +1,54 @@
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%discoverObjInst Discover Object Instance (rti initiated).
+%
+%Synopsis:
+% discoverObjInst(theObject, theObjectClass, theObjectName)
+%
+%Purpose:
+% Allows a federate to discover other objects that exist
+% in remote federates.
+
+% throw (
+% CouldNotDiscover,
+% ObjectClassNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global discoverU
+
+discoverU = true;
+
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) discoverObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/processFed_woTime/reflectAttrVal.m
===================================================================
RCS file: demo/TwoLevelController/processFed_woTime/reflectAttrVal.m
diff -N demo/TwoLevelController/processFed_woTime/reflectAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_woTime/reflectAttrVal.m 28 Jan 2008
21:46:21 -0000 1.1
@@ -0,0 +1,75 @@
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%reflectAttrVal Reflect Attribute Values (rti initiated).
+%
+%Synopsis:
+% reflectAttrVal(theObject,theAttributes,theTime,theTag,theHandle)
+% reflectAttrVal(theObject,theAttributes,theTag)
+%
+%Purpose:
+% Receive updates from the RTI of attributes that belong to
+% object class instances.
+
+% throw ( first method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global u
+global newU
+
+
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+u = net2double( theAttributes{1,2} );
+newU = true;
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) reflectAttrVal>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/processFed_wTime/discoverObjInst.m
===================================================================
RCS file: demo/TwoLevelController/processFed_wTime/discoverObjInst.m
diff -N demo/TwoLevelController/processFed_wTime/discoverObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_wTime/discoverObjInst.m 28 Jan 2008
21:46:22 -0000 1.1
@@ -0,0 +1,54 @@
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%discoverObjInst Discover Object Instance (rti initiated).
+%
+%Synopsis:
+% discoverObjInst(theObject, theObjectClass, theObjectName)
+%
+%Purpose:
+% Allows a federate to discover other objects that exist
+% in remote federates.
+
+% throw (
+% CouldNotDiscover,
+% ObjectClassNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global discoverU
+
+discoverU = true;
+
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) discoverObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/processFed_wTime/reflectAttrVal.m
===================================================================
RCS file: demo/TwoLevelController/processFed_wTime/reflectAttrVal.m
diff -N demo/TwoLevelController/processFed_wTime/reflectAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_wTime/reflectAttrVal.m 28 Jan 2008
21:46:22 -0000 1.1
@@ -0,0 +1,72 @@
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%reflectAttrVal Reflect Attribute Values (rti initiated).
+%
+%Synopsis:
+% reflectAttrVal(theObject,theAttributes,theTime,theTag,theHandle)
+% reflectAttrVal(theObject,theAttributes,theTag)
+%
+%Purpose:
+% Receive updates from the RTI of attributes that belong to
+% object class instances.
+
+% throw ( first method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global u
+
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+u = net2double( theAttributes{1,2} );
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) reflectAttrVal>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/processFed_wTime/timeAdvGrant.m
===================================================================
RCS file: demo/TwoLevelController/processFed_wTime/timeAdvGrant.m
diff -N demo/TwoLevelController/processFed_wTime/timeAdvGrant.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_wTime/timeAdvGrant.m 28 Jan 2008
21:46:22 -0000 1.1
@@ -0,0 +1,54 @@
+function timeAdvGrant(theTime)
+%timeAdvGrant Time Advance Grant (rti initiated).
+%
+%Synopsis:
+% timeAdvGrant(theTime)
+%
+%Purpose:
+% Informs me of the current time value I have been advanced to.
+% This is in response to one of the time advance sercices.
+
+% throw (
+% InvalidFederationTime,
+% TimeAdvanceWasNotInProgress,
+% FederationTimeAlreadyPassed,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global newTimeStep
+
+newTimeStep = true;
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) timeAdvGrant>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/processFed_wTime/processFed.m
===================================================================
RCS file: demo/TwoLevelController/processFed_wTime/processFed.m
diff -N demo/TwoLevelController/processFed_wTime/processFed.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/processFed_wTime/processFed.m 28 Jan 2008
21:46:22 -0000 1.1
@@ -0,0 +1,153 @@
+% process federate
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+rtiOn;
+
+federationName = 'TwoLevelController';
+federateName = 'processFed';
+fedFile = 'TwoLevelController.fed'
+
+disp('Create federation execution ....')
+
+e = createFedExec(federationName, fedFile)
+
+switch e
+ case ''
+ disp('created.');
+ case 'FederationExecutionAlreadyExists'
+ disp('already created.');
+ otherwise
+ error(['createFedExec failed: ' e])
+end
+
+disp('Join federation execution ...')
+
+[federateId, e] = joinFedExec( federateName, federationName);
+
+if isempty(e)
+ disp('joined.')
+else
+ error(['joinFedExec failed: ' e])
+end
+
+
+% get handles
+
+twoLevelContrID = getObjClassHdl('TwoLevelControllerClass')
+uID = getAttrHdl('U', twoLevelContrID)
+yID = getAttrHdl('Y', twoLevelContrID)
+
+subscribeObjClassAttr( twoLevelContrID, uID)
+publishObjClass(twoLevelContrID, yID)
+
+objInstID_y = registerObjInst(twoLevelContrID, 'y')
+
+tEnd = 30;
+tStart = 0;
+h = 0.1;
+w = 0.5;
+K = 1;
+T1 = 5;
+
+tSim = tStart;
+y = 0;
+ydot = 0;
+
+global u
+u = 1;
+
+global discoverU
+discoverU = false
+
+global newTimeStep
+newTimeStep = false
+
+disp('Init time management features.')
+
+e = enableTimeConstr
+e = enableTimeReg(tStart, h)
+
+e = enableAsyncDeliv
+
+disp('Wait for u')
+while ~discoverU
+ tick;
+ pause(0.5);
+end
+discoverU = false;
+disp('Got u')
+
+while ( tSim-tEnd <= 0 )
+
+ tick;
+ pause(0.001);
+
+ ydot = ( -y + u*K ) / T1;
+ y = y + h*ydot;
+
+ attrHdlSet = {yID, double2net(y)};
+
+ updateAttrVal(objInstID_y, attrHdlSet, tSim+h, 'y');
+
+ u
+ y
+ tSim = tSim + h
+
+ timeAdvReq(tSim);
+ while ~newTimeStep
+ tick;
+ pause(0.001)
+ end
+ newTimeStep = false;
+
+end
+
+disp('Resign Federation execution ... ')
+
+e = resignFedExec('dr');
+
+if isempty(e)
+ disp('resigned.');
+else
+ error(['resignFedExec failed: ' e])
+end
+
+
+disp('Destroy federation execution ... ');
+
+disp('Hit key to resume in creator of federation')
+pause
+
+e = destroyFedExec(federationName)
+
+switch e
+ case ''
+ disp('destroyed.');
+ case 'FederatesCurrentlyJoined'
+ disp('other federates still joined.');
+ case 'FederationExecutionDoesNotExist'
+ disp('Federation already destroyed.')
+ otherwise
+ rtiOff
+ error(['destroyFedExec: ' e])
+end
+
+rtiOff
Index: demo/Traffic-Distr1/observ/observ.m
===================================================================
RCS file: demo/Traffic-Distr1/observ/observ.m
diff -N demo/Traffic-Distr1/observ/observ.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/observ/observ.m 28 Jan 2008 21:46:22 -0000 1.1
@@ -0,0 +1,618 @@
+function varargout = observ(varargin)
+%observ Observer for Distributed Traffic Simulations / HLA
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+% switchboard for local sub-functions
+if nargin > 0
+ [varargout{1:nargout}] = feval(varargin{:});
+ return
+end
+
+
+% main function
+%DEBUG
+global LOG
+ LOG=fopen('log.txt','w');
+
+
+global T
+ T.Terminate = 0; % termination flag; set to 1
+ % by observ('terminate_Callback')
+
+
+ observ('init') % observer initialization
+
+ observ('hla_join') % join hla
+
+ keyboard
+
+ observ('loop') % observer loop
+
+ observ('hla_leave') % leave hla
+
+ observ('hla_down') % terminate hla
+return
+
+
+%--------------------------------------------------------------------
+function terminate_Callback
+%Set termination flag to 1
+
+global T
+
+ T.Terminate = 1;
+return
+
+
+%--------------------------------------------------------------------
+function init
+%Observer initialization
+
+global Cars
+ Cars.Lhdl = []; % local handles
+ Cars.Pos = []; % positions
+ Cars.Ghdl = []; % animation handles
+ Cars.Hhdl = []; % HLA instance handles
+
+global Peds
+ Peds.Lhdl = []; % local handles
+ Peds.Pos = []; % positions
+ Peds.Ghdl = []; % animation handles
+ Peds.Hhdl = []; % HLA instance handles
+
+ observ('init_anim')
+return
+
+
+%---------------------------------------------------------------
+function init_anim
+%Animation initialization
+
+ clf reset
+ cax = newplot;
+
+ set(get(cax,'Parent'), ... % figure properties
+ 'Name','observ', ...
+ 'NumberTitle','off', ...
+ 'DoubleBuffer','on', ... % ???, sonst Flimmern
+ 'BackingStore','off', ...
+ 'Colormap',[]);
+
+ set(cax, ... % axes properties
+ 'Visible','off', ...
+ 'Drawmode','Fast',...
+ 'NextPlot','add');
+ axis([0 20 0 20]); % 'Position'
+
+ plot([0 20],[11, 11],'k') % street for cars
+ plot([0 20],[ 9, 9],'k')
+ plot(9,9.3,'ko') % traffic light for cars
+
+ plot([ 9, 9],[0 20],'k') % path for peds
+ plot([11, 11],[0 20],'k')
+ plot(10.7,9,'ko') % traffic light for peds
+
+ uicontrol('String','Quit', ...
+ 'Callback','observ(''terminate_Callback'')');
+
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_join
+%Join HLA
+
+global HLA
+ HLA.RttCar = []; % HLA run-time-type for car objects
+ HLA.RttCarPos = []; % HLA run-time-type for car pos. attributes
+ HLA.RttPed = []; % HLA run-time-type for ped objects
+ HLA.RttPedPos = []; % HLA run-time-type for ped pos. attributes
+ HLA.RttTrl = []; % HLA run-time-type for trl event class
+ HLA.RttTrlEvent = []; % HLA run-time-type for trl event parameter
+
+ % Connect to RTI
+ rtiOn
+
+ % Create federation
+ e = createFedExec('Traffic-Distr1','TrafficDistr1.fed');
+ if ~isempty(e) & ~strcmp(e,'FederationExecutionAlreadyExists')
+ error(['createFedExec failed: ' e])
+ end
+
+ % Join federation
+ e = 'FederationExecutionDoesNotExist';
+ while strcmp(e,'FederationExecutionDoesNotExist')
+ [federateId, e] = joinFedExec('observ','Traffic-Distr1');
+ pause(1)
+ end
+ if ~isempty(e)
+ error(['joinFedExec failed: ' e])
+ end
+
+ % RTT identification
+ HLA.RttCar = getObjClassHdl( 'Car');
+ HLA.RttCarPos = getAttrHdl( 'Pos', HLA.RttCar);
+
+ HLA.RttPed = getObjClassHdl( 'Ped');
+ HLA.RttPedPos = getAttrHdl( 'Pos', HLA.RttPed);
+
+ HLA.RttTrl = getInteractClassHdl('Trl');
+ HLA.RttTrlEvent = getParamHdl( 'Event', HLA.RttTrl);
+
+ % Subscribe Car, Ped and Trl
+ subscribeObjClassAttr(HLA.RttCar, HLA.RttCarPos);
+ subscribeObjClassAttr(HLA.RttPed, HLA.RttPedPos);
+ % --> Callback discoverObjInst()
+ % --> Callback reflectAttrVal()
+ % --> Callback removeObjInst()
+ subscribeInteractClass(HLA.RttTrl);
+ % --> receiveInteract()
+return
+
+
+%---------------------------------------------------------------
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%Invoked by RTI to tell observer new object instances of other federates
+
+global HLA
+
+ switch theObjectClass
+
+ case HLA.RttCar
+
+ %DEBUG
+ disp(['discover car' theObjectName])
+ global LOG
+ fprintf(LOG,'%s\n',['discover car' theObjectName]);
+
+ observ('car_generate', theObject, theObjectName)
+
+ case HLA.RttPed
+
+ %DEBUG
+ disp(['discover ped' theObjectName])
+ global LOG
+ fprintf(LOG,'%s\n',['discover ped' theObjectName]);
+
+ observ('ped_generate', theObject, theObjectName)
+
+ otherwise
+
+ %DEBUG
+ disp(['discover UNKNOWN' theObjectName])
+ global LOG
+ fprintf(LOG,'%s\n',['discover UNKNOWN' theObjectName]);
+
+ error('discoverObjInst failed: unknown ObjClass')
+ end
+return
+
+
+%---------------------------------------------------------------
+function car_generate(hhdl,lhdl)
+%Creates new cars
+
+global Cars
+
+ lhdl = str2num(lhdl);
+ pos = 0;
+ ghdl = observ('car_generate_anim', lhdl);
+
+ Cars.Lhdl = [lhdl Cars.Lhdl];;
+ Cars.Pos = [pos Cars.Pos ];
+ Cars.Ghdl = [ghdl Cars.Ghdl];
+ Cars.Hhdl = [hhdl Cars.Hhdl];
+return
+
+
+%---------------------------------------------------------------
+function ghdl = car_generate_anim(lhdl)
+%Animates creation of new cars
+
+ x = 0; y = 10;
+ xl = 0.4; yl = 0.4;
+
+ ghdl = patch([x-xl,x-xl,x+xl,x+xl],...
+ [y-yl,y+yl,y+yl,y-yl],...
+ 'g');
+
+ text_ghdl = text(x,y,int2str(lhdl),'HorizontalAlignment','center');
+
+ set(ghdl,'UserData',text_ghdl)
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function ped_generate(hhdl,lhdl)
+%Creates new peds
+
+global Peds
+
+ lhdl = str2num(lhdl);
+ pos = 0;
+ ghdl = observ('ped_generate_anim', lhdl);
+
+ Peds.Lhdl = [lhdl Peds.Lhdl];;
+ Peds.Pos = [pos Peds.Pos ];
+ Peds.Ghdl = [ghdl Peds.Ghdl];
+ Peds.Hhdl = [hhdl Peds.Hhdl];
+return
+
+
+%---------------------------------------------------------------
+function ghdl = ped_generate_anim(lhdl)
+%Animates creation of new peds
+
+ x = 10; y = 0;
+ xl = 0.2; yl = 0.4;
+
+ ghdl = patch([x-xl,x-xl,x+xl,x+xl],...
+ [y-yl,y+yl,y+yl,y-yl],...
+ 'g');
+
+ text_ghdl = text(x,y,int2str(lhdl),'HorizontalAlignment','center');
+
+ set(ghdl,'UserData',text_ghdl)
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%Invoked by RTI to tell observer new updates of subscribed object instances
+
+if (nargin == 6)
+ % treatment of reflectAttrVal(6 input param) is not needed;
+ % instead default implementation
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+
+ cmd='';
+
+ while ~strcmp(cmd,'return')
+ cmd = input('(observ) reflectAttrVal(5 arg var)>> ','s');
+ eval(cmd,'error_handler')
+ end
+
+else
+ % reflectAttrVal(3 input param) is used and implemented here
+ theTag = in3;
+ clear in3
+
+ global Cars Peds
+
+ %DEBUG
+ disp(['reflect ' theTag])
+ global LOG
+ fprintf(LOG,'%s\n',['reflect ' theTag]);
+
+ idxc = find( Cars.Hhdl(:) == theObject );
+ idxp = find( Peds.Hhdl(:) == theObject );
+ if ~isempty(idxc)
+ new_pos = net2double(theAttributes{2});
+ observ('car_move', idxc, new_pos)
+ elseif ~isempty(idxp)
+ new_pos = net2double(theAttributes{2});
+ observ('ped_move', idxp, new_pos)
+ else
+ error('reflectAttrVal failed: unknown Object')
+ end
+end
+
+return
+
+
+%---------------------------------------------------------------
+function car_move(idx,new_pos)
+%Moves cars
+
+global Cars
+
+ delta_x = new_pos - Cars.Pos(idx);
+ Cars.Pos(idx) = Cars.Pos(idx) + delta_x;
+
+ observ('car_move_anim', Cars.Ghdl(idx), delta_x )
+return
+
+
+%---------------------------------------------------------------
+function car_move_anim(ghdl,delta_x)
+%Animates moving cars
+
+ set(ghdl,'XDATA', ...
+ get(ghdl,'XDATA') ...
+ + delta_x )
+
+ text_ghdl = get(ghdl,'UserData');
+ pos = get(text_ghdl,'Position');
+ pos(1) = pos(1) + delta_x;
+ set(text_ghdl,'Position',pos);
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function ped_move(idx,new_pos)
+%Moves peds
+
+global Peds
+
+ delta_y = new_pos - Peds.Pos(idx);
+ Peds.Pos(idx) = Peds.Pos(idx) + delta_y;
+
+ observ('ped_move_anim', Peds.Ghdl(idx), delta_y )
+return
+
+
+%---------------------------------------------------------------
+function ped_move_anim(ghdl,delta_y)
+%Animates moving peds
+
+ set(ghdl,'YDATA', ...
+ get(ghdl,'YDATA') ...
+ + delta_y )
+
+ text_ghdl = get(ghdl,'UserData');
+ pos = get(text_ghdl,'Position');
+ pos(2) = pos(2) + delta_y;
+ set(text_ghdl,'Position',pos);
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function removeObjInst(theObject,in2,in3,in4)
+%Invoked by RTI to tell observer that subscribed obj. inst. not longer exist
+
+if (nargin == 5)
+ % treatment of removeObjInst(5 input param) is not needed;
+ % instead default implementation
+ theTime = in2;
+ theTag = in3;
+ theHandle = in4;
+ clear in2 in3 in4
+
+ cmd='';
+
+ while ~strcmp(cmd,'return')
+ cmd = input('(observ) removeObjInst(4 arg var)>> ','s');
+ eval(cmd,'error_handler')
+ end
+
+else
+ % removeObjInst(2 input param) is used and implemented here
+ theTag = in2;
+ clear in2
+
+ global Cars Peds
+
+ %DEBUG
+ disp(['remove ' theTag]);
+ global LOG
+ fprintf(LOG,'%s\n',['remove ' theTag]);
+
+ idxc = find( Cars.Hhdl(:) == theObject);
+ idxp = find( Peds.Hhdl(:) == theObject);
+ if ~isempty(idxc)
+ observ('car_destroy', idxc)
+ elseif ~isempty(idxp)
+ observ('ped_destroy', idxp)
+ else
+ error('removeObjInst failed: unknown Object')
+ end
+end
+
+return
+
+
+%---------------------------------------------------------------
+function car_destroy(idx)
+%Destroys cars
+
+global Cars
+
+ observ('car_destroy_anim', Cars.Ghdl(idx))
+
+ Cars.Lhdl = Cars.Lhdl([1:idx-1,idx+1:end]);
+ Cars.Pos = Cars.Pos([1:idx-1,idx+1:end]);
+ Cars.Ghdl = Cars.Ghdl([1:idx-1,idx+1:end]);
+ Cars.Hhdl = Cars.Hhdl([1:idx-1,idx+1:end]);
+return
+
+
+%---------------------------------------------------------------
+function car_destroy_anim(ghdl)
+%Animates destroying cars
+
+ text_ghdl = get(ghdl,'UserData');
+
+ delete(text_ghdl)
+
+ delete(ghdl)
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function ped_destroy(idx)
+%Destroys peds
+
+global Peds
+
+ observ('ped_destroy_anim', Peds.Ghdl(idx))
+
+ Peds.Lhdl = Peds.Lhdl([1:idx-1,idx+1:end]);
+ Peds.Pos = Peds.Pos([1:idx-1,idx+1:end]);
+ Peds.Ghdl = Peds.Ghdl([1:idx-1,idx+1:end]);
+ Peds.Hhdl = Peds.Hhdl([1:idx-1,idx+1:end]);
+return
+
+
+%---------------------------------------------------------------
+function ped_destroy_anim(ghdl)
+%Animates destroying peds
+
+ text_ghdl = get(ghdl,'UserData');
+
+ delete(text_ghdl)
+
+ delete(ghdl)
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%Invoked by RTI to tell the federate interactions sent from remote federates.
+
+if (nargin == 5)
+ % treatment of receiveInteract(5 input args) method;
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+
+ error('receiveInteract(5 input args) not implemented')
+
+else
+ % treatment of receiveInteract(3 input args) method;
+ theTag = in3;
+ clear in3
+
+ global HLA
+
+ %DEBUG
+ disp(['receive ' theTag])
+ global LOG
+ fprintf(LOG,'%s\n',['receive ' theTag]);
+
+ if theInteraction == HLA.RttTrl
+ event = net2char(theParameters{2});
+ switch event
+ case abs('c'), observ('trl_car_green')
+ case abs('p'), observ('trl_ped_green')
+ otherwise, error('Unknown event.')
+ end
+
+
+ else
+ error('receiveInteract failed: unknown InteractClass')
+ end
+
+end
+
+return
+
+
+%------------------------------------------------------------------
+function trl_car_green
+%Switch traffic ligth to car green
+
+ observ('trl_car_green_anim')
+return
+
+
+%-------------------------------------------------------------
+function trl_car_green_anim
+%Animates switching traffic ligth to car green
+
+ plot( 9.0,9.3,'g*') % green for cars
+ plot(10.7,9.0,'r*') % red for peds
+
+ drawnow
+return
+
+
+%------------------------------------------------------------------
+function trl_ped_green
+%Switch traffic ligth to ped green
+
+ observ('trl_ped_green_anim')
+return
+
+
+%---------------------------------------------------------------
+function trl_ped_green_anim
+%Animates switching traffic ligth to ped green
+
+ plot( 9.0,9.3,'r*') % red for cars
+ plot(10.7,9.0,'g*') % green for peds
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function loop
+%Observer loop
+
+global T
+
+ while ~T.Terminate % loop
+
+ tick(0.3,0.3); % take over control to RTI
+
+ drawnow % process anim. callbacks
+ end
+return
+
+
+%---------------------------------------------------------------
+function hla_leave
+%Leave HLA
+
+ % Resign federation
+ e = resignFedExec;
+ if ~isempty(e)
+ error(['resignFedExec failed: ' e])
+ end
+return
+
+
+%---------------------------------------------------------------
+function hla_down
+%Destroy federation Traffic-Distr1 and disconnect from RTI
+
+ % Destroy federation
+ e = destroyFedExec('Traffic-Distr1');
+ if ~isempty(e) & ~strcmp(e,'FederatesCurrentlyJoined')
+ error(['destroyFedExec failed: ' e])
+ end
+
+ % Disconnect from RTI
+ rtiOff
+return
+
+
Index: demo/Traffic-Distr1/observ/receiveInteract.m
===================================================================
RCS file: demo/Traffic-Distr1/observ/receiveInteract.m
diff -N demo/Traffic-Distr1/observ/receiveInteract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/observ/receiveInteract.m 28 Jan 2008 21:46:23
-0000 1.1
@@ -0,0 +1,86 @@
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%receiveInteract Receive Interactions (rti initiated).
+%
+%Synopsis:
+% receiveInteract(theInteraction,theParameters,theTime,theTag,theHandle)
+% receiveInteract(theInteraction,theParameters,theTag)
+%
+%Purpose:
+% Receive interactions sent from remote federates.
+
+% throw ( first method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+if (nargin == 5)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in
+ observ('receiveInteract', ...
+ theInteraction, theParameters, theTime, theTag, theHandle)
+else
+ theTag = in3;
+ clear in3
+ observ('receiveInteract', ...
+ theInteraction, theParameters, theTag)
+end
+
+return
+
+
+%---------------------------------------------------------------
+%------------------------- default impl. ------------------------
+if (nargin == 5)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) receiveInteract>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
Index: demo/Traffic-Distr1/observ/discoverObjInst.m
===================================================================
RCS file: demo/Traffic-Distr1/observ/discoverObjInst.m
diff -N demo/Traffic-Distr1/observ/discoverObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/observ/discoverObjInst.m 28 Jan 2008 21:46:23
-0000 1.1
@@ -0,0 +1,59 @@
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%discoverObjInst Discover Object Instance (rti initiated).
+%
+%Synopsis:
+% discoverObjInst(theObject, theObjectClass, theObjectName)
+%
+%Purpose:
+% Allows a federate to discover other objects that exist
+% in remote federates.
+
+% throw (
+% CouldNotDiscover,
+% ObjectClassNotKnown,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+disp('HELLO');
+observ('discoverObjInst', theObject, theObjectClass, theObjectName)
+
+return
+
+
+%--------------------------------------------------------------
+%----------------------- default impl. ------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) discoverObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
+
Index: demo/Traffic-Distr1/observ/removeObjInst.m
===================================================================
RCS file: demo/Traffic-Distr1/observ/removeObjInst.m
diff -N demo/Traffic-Distr1/observ/removeObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/observ/removeObjInst.m 28 Jan 2008 21:46:23 -0000
1.1
@@ -0,0 +1,85 @@
+function removeObjInst(theObject,in2,in3,in4)
+%removeObjInst Remove Object Instance (rti initiated).
+%
+%Synopsis:
+% removeObjInst(theObject, theTime, theTag, theHandle)
+% removeObjInst(theObject, theTag)
+%Purpose:
+% Either, a remote federate has deleted one of its object instances
+% or it no longer meets my subscription criteria so the RTI is
+% telling me that I can remove the object Id from my database.
+
+% throw ( first method
+% ObjectNotKnown,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+if (nargin == 5)
+ theTime = in2;
+ theTag = in3;
+ theHandle = in4;
+ clear in2 in3 in4
+ observ('removeObjInst', ...
+ theObject, theTime, theTag, theHandle)
+else
+ theTag = in2;
+ clear in2
+ observ('removeObjInst', ...
+ theObject, theTag)
+end
+
+return
+
+
+%--------------------------- default impl. ----------------------
+if (nargin == 5)
+ theTime = in2;
+ theTag = in3;
+ theHandle = in4;
+ clear in2 in3 in4
+else
+ theTag = in2;
+ clear in2
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) removeObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
+
Index: demo/Traffic-Distr1/observ/reflectAttrVal.m
===================================================================
RCS file: demo/Traffic-Distr1/observ/reflectAttrVal.m
diff -N demo/Traffic-Distr1/observ/reflectAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/observ/reflectAttrVal.m 28 Jan 2008 21:46:23 -0000
1.1
@@ -0,0 +1,90 @@
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%reflectAttrVal Reflect Attribute Values (rti initiated).
+%
+%Synopsis:
+% reflectAttrVal(theObject,theAttributes,theTime,theTag,theHandle)
+% reflectAttrVal(theObject,theAttributes,theTag)
+%
+%Purpose:
+% Receive updates from the RTI of attributes that belong to
+% object class instances.
+
+% throw ( first method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+if (nargin == 5)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+ observ('reflectAttrVal', ...
+ theObject, theAttributes, theTime, theTag, theHandle)
+else
+ theTag = in3;
+ clear in3
+ observ('reflectAttrVal', ...
+ theObject, theAttributes, theTag)
+end
+
+return
+
+
+%---------------------------------------------------------------
+%------------------------- default impl. ------------------------
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) reflectAttrVal>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
+
Index: demo/TwoLevelController/controlFed_woTime/discoverObjInst.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_woTime/discoverObjInst.m
diff -N demo/TwoLevelController/controlFed_woTime/discoverObjInst.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_woTime/discoverObjInst.m 28 Jan 2008
21:46:23 -0000 1.1
@@ -0,0 +1,54 @@
+function discoverObjInst(theObject, theObjectClass, theObjectName)
+%discoverObjInst Discover Object Instance (rti initiated).
+%
+%Synopsis:
+% discoverObjInst(theObject, theObjectClass, theObjectName)
+%
+%Purpose:
+% Allows a federate to discover other objects that exist
+% in remote federates.
+
+% throw (
+% CouldNotDiscover,
+% ObjectClassNotKnown,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global discoverY
+
+discoverY = true;
+
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) discoverObjInst>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/TwoLevelController/controlFed_woTime/controlFed.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_woTime/controlFed.m
diff -N demo/TwoLevelController/controlFed_woTime/controlFed.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_woTime/controlFed.m 28 Jan 2008
21:46:23 -0000 1.1
@@ -0,0 +1,144 @@
+% control federate
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+rtiOn;
+
+federationName = 'TwoLevelController';
+federateName = 'controlFed';
+fedFile = 'TwoLevelController.fed'
+
+disp('Create federation execution ....')
+
+e = createFedExec(federationName, fedFile)
+
+switch e
+ case ''
+ disp('created.');
+ case 'FederationExecutionAlreadyExists'
+ disp('already created.');
+ otherwise
+ error(['createFedExec failed: ' e])
+end
+
+disp('Join federation execution ...')
+
+[federateId, e] = joinFedExec( federateName, federationName);
+
+if isempty(e)
+ disp('joined.')
+else
+ error(['joinFedExec failed: ' e])
+end
+
+
+% get handles
+
+twoLevelContrID = getObjClassHdl('TwoLevelControllerClass')
+uID = getAttrHdl('U', twoLevelContrID)
+yID = getAttrHdl('Y', twoLevelContrID)
+
+subscribeObjClassAttr( twoLevelContrID, yID);
+publishObjClass(twoLevelContrID, uID);
+
+objInstID_u = registerObjInst(twoLevelContrID, 'u')
+
+global discoverY
+discoverY = false
+
+disp('Wait for y')
+while ~discoverY
+ tick;
+ pause(0.5)
+end
+discoverY = false;
+disp('Got y')
+
+tEnd = 30;
+tStart = 0;
+h = 0.1;
+w = 0.5;
+K = 1;
+T1 = 5;
+
+tSim = tStart;
+u = 1;
+
+global newY
+newY = false;
+
+global y
+y = 0;
+
+while ( tSim-tEnd <= 0 )
+
+ tick;
+ pause(0.001);
+
+ if (y < w-0.1 ), u=1; end
+ if (y > w+0.1 ), u=0; end
+
+ attrHdlSet = {uID, double2net(u)};
+
+ updateAttrVal(objInstID_u, attrHdlSet, 'u')
+
+ while ~newY
+ tick;
+ pause(0.001);
+ end
+ newY = false;
+
+ y
+ u
+ tSim = tSim + h
+end
+
+disp('Resign Federation execution ... ')
+
+e = resignFedExec('dr');
+
+if isempty(e)
+ disp('resigned.');
+else
+ error(['resignFedExec failed: ' e])
+end
+
+
+disp('Destroy federation execution ... ');
+
+disp('Hit key to resume in creator of federation')
+pause
+
+e = destroyFedExec(federationName)
+
+switch e
+ case ''
+ disp('destroyed.');
+ case 'FederatesCurrentlyJoined'
+ disp('other federates still joined.');
+ case 'FederationExecutionDoesNotExist'
+ disp('Federation already destroyed.')
+ otherwise
+ rtiOff
+ error(['destroyFedExec: ' e])
+end
+
+rtiOff
+
Index: demo/TwoLevelController/controlFed_woTime/reflectAttrVal.m
===================================================================
RCS file: demo/TwoLevelController/controlFed_woTime/reflectAttrVal.m
diff -N demo/TwoLevelController/controlFed_woTime/reflectAttrVal.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/controlFed_woTime/reflectAttrVal.m 28 Jan 2008
21:46:24 -0000 1.1
@@ -0,0 +1,74 @@
+function reflectAttrVal(theObject,theAttributes,in3,in4,in5)
+%reflectAttrVal Reflect Attribute Values (rti initiated).
+%
+%Synopsis:
+% reflectAttrVal(theObject,theAttributes,theTime,theTag,theHandle)
+% reflectAttrVal(theObject,theAttributes,theTag)
+%
+%Purpose:
+% Receive updates from the RTI of attributes that belong to
+% object class instances.
+
+% throw ( first method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% ObjectNotKnown,
+% AttributeNotKnown,
+% FederateOwnsAttributes,
+% FederateInternalError)
+
+% Copyright (C) 2008 Christian Stenzel, Sven Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+global y
+global newY
+
+if (nargin == 6)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+y = net2double( theAttributes{1,2} );
+newY = true;
+
+return
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) reflectAttrVal>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
\ No newline at end of file
Index: demo/Traffic-Distr1/ped_ts/startRegForObjClass.m
===================================================================
RCS file: demo/Traffic-Distr1/ped_ts/startRegForObjClass.m
diff -N demo/Traffic-Distr1/ped_ts/startRegForObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/ped_ts/startRegForObjClass.m 28 Jan 2008 21:46:24
-0000 1.1
@@ -0,0 +1,56 @@
+function startRegForObjClass(theClass)
+%startRegForObjClass Start Registration for Object Class (rti initiated).
+%
+%Synopsis:
+% startRegForObjClass(theClass)
+%
+%Purpose:
+% To inform the federate that other federates in the federation
+% execution have subscribed to an object class that it has
+% published.
+
+% throw (
+% ObjectClassNotPublished,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+ped_ts('startRegForObjClass', theClass)
+
+return
+
+
+%-------------------- default impl. -------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) startRegForObjClass>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
Index: demo/Traffic-Distr1/ped_ts/ped_ts.m
===================================================================
RCS file: demo/Traffic-Distr1/ped_ts/ped_ts.m
diff -N demo/Traffic-Distr1/ped_ts/ped_ts.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/ped_ts/ped_ts.m 28 Jan 2008 21:46:24 -0000 1.1
@@ -0,0 +1,616 @@
+function varargout = ped_ts(varargin)
+%ped_ts Time-Step Simulation of Pedestrian Traffic / HLA
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+% switchboard for local sub-functions
+if nargin > 0
+ [varargout{1:nargout}] = feval(varargin{:});
+ return
+end
+
+
+% main function
+%DEBUG
+global LOG
+ LOG=fopen('log.txt','w');
+
+
+global T
+ T.Current = 0; % start and current time
+ T.Step = 1; % time step
+ T.Terminate = 0; % termination flag; set to 1
+ % by ped_ts('terminate_Callback')
+ T.Continue = 1; % continuation flag; set to
+ % 0 by ped_ts('stop_Callback')
+ % 1 by ped_ts('cont_Callback')
+ % -1 by ped_ts('step_Callback')
+
+
+ ped_ts('init') % model init
+
+ ped_ts('hla_join') % join hla
+
+ ped_ts('loop') % simulation loop
+
+ ped_ts('hla_leave') % leave hla
+
+ ped_ts('hla_down') % terminate hla
+return
+
+
+%--------------------------------------------------------------------
+function terminate_Callback
+%Set termination flag to 1
+
+global T
+
+ T.Terminate = 1;
+return
+
+
+%--------------------------------------------------------------------
+function stop_Callback
+%Set continue flag to 0
+
+global T
+
+ T.Continue = 0;
+return
+
+
+%--------------------------------------------------------------------
+function cont_Callback
+%Set continue flag to 1
+
+global T
+
+ T.Continue = 1;
+return
+
+
+%--------------------------------------------------------------------
+function step_Callback
+%Set continue flag to -1
+
+global T
+
+ T.Continue = -1;
+return
+
+
+%--------------------------------------------------------------------
+function init
+%Model initialization
+
+global Peds
+ Peds.NextLhdl = 1; % next local handle
+ Peds.Lhdl = []; % local handles
+ Peds.Pos = []; % positions
+ Peds.Ghdl = []; % animation handles
+ Peds.Hhdl = []; % HLA instance handles
+ Peds.Barrier = 0; % barrier on path on/off and position
+
+ ped_ts('init_anim')
+return
+
+
+%------------------------------------------------------------------
+function init_anim
+%Animation initialization
+
+ clf reset
+ cax = newplot;
+
+ set(get(cax,'Parent'), ... % figure properties
+ 'Name','ped_ts', ...
+ 'NumberTitle','off', ...
+ 'DoubleBuffer','on', ... % ???, sonst Flimmern
+ 'BackingStore','off', ...
+ 'Colormap',[]);
+
+ set(cax, ... % axes properties
+ 'Visible','off', ...
+ 'Drawmode','Fast',...
+ 'NextPlot','add');
+ axis([0 20 0 20]); % 'Position'
+
+ plot([ 9, 9],[0 20],'k')
+ plot([11, 11],[0 20],'k')
+
+global Ghdl
+ Ghdl.TCurrent = text(1,18,'t = ');
+ Ghdl.Barrier = plot([9 11],[9 9],'r','Visible','off');
+
+ uicontrol('String','Barrier',...
+ 'Callback','ped_ts(''barrier_Callback'')',...
+ 'Position',[200 190 60 20]);
+
+ uicontrol('String','Quit',...
+ 'Callback','ped_ts(''terminate_Callback'')');
+
+ uicontrol('String','Stop', ...
+ 'Callback','ped_ts(''stop_Callback'')', ...
+ 'Position',[130 20 60 20]);
+
+ uicontrol('String','Step', ...
+ 'Callback','ped_ts(''step_Callback'')', ...
+ 'Position',[230 20 60 20]);
+
+ uicontrol('String','Cont', ...
+ 'Callback','ped_ts(''cont_Callback'')', ...
+ 'Position',[330 20 60 20]);
+
+ drawnow
+return
+
+
+%------------------------------------------------------------------
+function barrier_Callback(action)
+%Toggles Peds.Barrier
+
+global Peds
+
+ if nargin < 1
+
+ if Peds.Barrier
+ Peds.Barrier = 0;
+ else
+ Peds.Barrier = 9;
+ end
+
+ else
+
+ if action == 'p'
+ Peds.Barrier = 0;
+ else
+ Peds.Barrier = 9;
+ end
+ end
+
+ ped_ts('barrier_anim', Peds.Barrier)
+return
+
+
+%---------------------------------------------------------------
+function barrier_anim(barr)
+%Animates Peds.Barrier
+
+global Ghdl
+
+ if barr
+ set(Ghdl.Barrier,'Visible','on');
+ else
+ set(Ghdl.Barrier,'Visible','off');
+ end
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_join
+%Join HLA
+
+global HLA
+ HLA.RttPed = []; % HLA run-time-type for ped objects
+ HLA.RttPedPos = []; % HLA run-time-type for ped pos. attributes
+ HLA.RttTrl = []; % HLA run-time-type for trl event class
+ HLA.RttTrlEvent = []; % HLA run-time-type for trl event parameter
+
+
+ % Connect to RTI
+ rtiOn
+
+ % Create federation
+ e = createFedExec('Traffic-Distr1','TrafficDistr1.fed');
+ if ~isempty(e) & ~strcmp(e,'FederationExecutionAlreadyExists')
+ error(['createFedExec failed: ' e])
+ end
+
+ % Join federation
+ e = 'FederationExecutionDoesNotExist';
+ while strcmp(e,'FederationExecutionDoesNotExist')
+ [federateId, e] = joinFedExec('ped_ts','Traffic-Distr1');
+ pause(1)
+ end
+ if ~isempty(e)
+ error(['joinFedExec failed: ' e])
+ end
+
+
+ % RTT identification
+ HLA.RttPed = getObjClassHdl('Ped');
+ HLA.RttPedPos = getAttrHdl( 'Pos', HLA.RttPed);
+
+ HLA.RttTrl = getInteractClassHdl('Trl');
+ HLA.RttTrlEvent = getParamHdl( 'Event', HLA.RttTrl);
+
+
+ % Publish Ped
+ publishObjClass(HLA.RttPed, HLA.RttPedPos);
+ % Wenn durch ein anderes Federate subscribeObjClassAttr()
+ % aufgerufen wird, erhaelt dieses Federate den startRegForObjClass()
+ % Callback.
+ % Dieser Informationsmechanismus koennte hier mit
+ % disableClassRelevanceAdvisorySwitch() abgeschaltet werden.
+ % Hier wurde aber nur der startRegForObjClass() Callback als
+ % Nop implementiert.
+ % Analoges gilt fuer stopRegForObjClass()
+
+ % Subscribe Trl
+ subscribeInteractClass(HLA.RttTrl);
+return
+
+
+%---------------------------------------------------------------
+function startRegForObjClass(theClass)
+%Invoked by RTI to inform the federate that other federates have subscribed
+%to a published object class.
+
+disp('(ped_ts) startRegForObjClass>> ... no operation');
+
+return
+
+
+%---------------------------------------------------------------
+function stopRegForObjClass(theClass)
+%Invoked by RTI to inform the federate that no longer any other federate
+%have subscribed a published object class.
+
+disp('(ped_ts) stopRegForObjClass>> ... no operation');
+
+return
+
+
+%---------------------------------------------------------------
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%Invoked by RTI to tell the federate interactions sent from remote federates.
+
+if (nargin == 5)
+ % treatment of receiveInteract(5 input param) is not needed;
+ % instead default implementation
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+
+ cmd='';
+
+ while ~strcmp(cmd,'return')
+ cmd = input('(ped_ts) receiveInteract(5 arg var)>> ','s');
+ eval(cmd,'error_handler')
+ end
+
+else
+ % receiveInteract(2 input param) is used and implemented here
+ theTag = in3;
+ clear in3
+
+ global HLA
+
+ %DEBUG
+ disp(['receive ' theTag])
+ global LOG
+ fprintf(LOG,'%s\n',['receive ' theTag]);
+
+ if theInteraction == HLA.RttTrl
+ event = net2char(theParameters{2});
+ ped_ts('barrier_Callback', event)
+ else
+ error('receiveInteract failed: unknown InteractClass')
+ end
+
+end
+
+return
+
+
+%---------------------------------------------------------------
+function loop
+%ped_ts loop
+
+global T
+
+ while ~T.Terminate % simulation loop
+
+ [trash,e] = tick(0.3,0.3); if ~isempty(e), error(e), end
+
+ ped_ts('generate')
+
+ ped_ts('move')
+
+ ped_ts('destroy')
+
+ ped_ts('time_step')
+
+ if T.Continue == 0
+ while T.Continue == 0
+ drawnow % stop
+ end
+ elseif T.Continue == -1
+ T.Continue = 0;
+ while T.Continue == 0
+ drawnow % step
+ end
+ end
+ end
+return
+
+
+%------------------------------------------------------------------
+function generate
+%Creates new peds
+
+global Peds
+
+ full = 0;
+ if ~isempty(Peds.Lhdl)
+ if Peds.Pos(1) == 0
+ full = 1;
+ end
+ end
+
+ if ~full & rand > 0.5
+ lhdl = Peds.NextLhdl;
+ pos = 0;
+ ghdl = ped_ts('generate_anim', lhdl);
+ hhdl = ped_ts('hla_register', lhdl);
+
+ Peds.Lhdl = [lhdl Peds.Lhdl];
+ Peds.Pos = [pos Peds.Pos ];
+ Peds.Ghdl = [ghdl Peds.Ghdl];
+ Peds.Hhdl = [hhdl Peds.Hhdl];
+
+ Peds.NextLhdl = Peds.NextLhdl + 1;
+ end
+return
+
+
+%-----------------------------------------------------------
+function ghdl = generate_anim(lhdl)
+%Animates creation of new peds
+
+ x = 10; y = 0;
+ xl = 0.2; yl = 0.4;
+
+ ghdl = patch([x-xl,x-xl,x+xl,x+xl],...
+ [y-yl,y+yl,y+yl,y-yl],...
+ 'g');
+
+ text_ghdl = text(x,y,int2str(lhdl),'HorizontalAlignment','center');
+
+ set(ghdl,'UserData',text_ghdl)
+
+ drawnow
+return
+
+
+%-----------------------------------------------------------
+function hhdl = hla_register(lhdl)
+%hla_register HLA: neuen Fussgaenger registrieren
+
+global HLA
+
+ %DEBUG
+ disp(['register ped' int2str(lhdl) ])
+ global LOG
+ fprintf(LOG,'%s\n',['register ped' int2str(lhdl) ]);
+
+ hhdl = registerObjInst(HLA.RttPed, int2str(lhdl) );
+
+return
+
+
+%--------------------------------------------------------------------
+function move
+%Moves peds
+
+global Peds
+
+ idx = find( Peds.Pos(:) >= Peds.Barrier ); % peds upon or behind barr.
+ if ~isempty(idx)
+ Peds.Pos(idx) = Peds.Pos(idx) + 1;
+
+ ped_ts('move_anim', Peds.Ghdl(idx));
+
+ ped_ts('hla_update', Peds.Hhdl(idx), ...
+ Peds.Pos(idx), ...
+ Peds.Lhdl(idx) );
+ end
+
+ idx = find( Peds.Pos(:) < Peds.Barrier ); % peds in front of barrier
+ if ~isempty(idx)
+ if Peds.Pos(idx(end)) < Peds.Barrier-1 % ped next to barrier
+ Peds.Pos(idx(end)) = Peds.Pos(idx(end)) + 1;
+
+ ped_ts('move_anim', Peds.Ghdl(idx(end)));
+
+ ped_ts('hla_update', Peds.Hhdl(idx(end)), ...
+ Peds.Pos(idx(end)), ...
+ Peds.Lhdl(idx(end)) );
+ end
+ end
+ for i=1:length(idx)-1 % rest of peds
+ if Peds.Pos(i) < Peds.Pos(i+1)-1
+ Peds.Pos(i) = Peds.Pos(i) + 1;
+
+ ped_ts('move_anim', Peds.Ghdl(i));
+
+ ped_ts('hla_update', Peds.Hhdl(idx(end)), ...
+ Peds.Pos(idx(end)), ...
+ Peds.Lhdl(idx(end)) );
+ end
+ end
+return
+
+
+%--------------------------------------------------------------------
+function move_anim(ghdl)
+%Animates moving peds
+%
+% move_anim(ghdl) ghdl may be a vector
+
+ for i=ghdl
+ set(i,'YDATA', ...
+ get(i,'YDATA') ...
+ + 1 )
+
+ text_ghdl = get(i,'UserData');
+ pos = get(text_ghdl,'Position');
+ pos(2) = pos(2) + 1;
+ set(text_ghdl,'Position',pos);
+ end
+
+ drawnow
+return
+
+
+%--------------------------------------------------------------------
+function hla_update(hhdl,pos,lhdl)
+%hla_update
+
+global HLA
+
+ for i=1:length(hhdl)
+
+ tag = ['ped' int2str(lhdl(i))];
+
+ %DEBUG
+ disp(['update ' tag])
+ global LOG
+ fprintf(LOG,'%s\n',['update ' tag]);
+
+ updateAttrVal( hhdl(i), ...
+ {HLA.RttPedPos, double2net(pos(i))}, ...
+ tag);
+ end
+return
+
+
+%--------------------------------------------------------------------
+function destroy
+%Destroys peds
+
+global Peds
+
+ if ~isempty(Peds.Lhdl)
+ if Peds.Pos(end) > 20
+ ped_ts('hla_delete', Peds.Hhdl(end), Peds.Lhdl(end));
+
+ ped_ts('destroy_anim', Peds.Ghdl(end) )
+
+ Peds.Lhdl = Peds.Lhdl(1:end-1);
+ Peds.Pos = Peds.Pos(1:end-1);
+ Peds.Ghdl = Peds.Ghdl(1:end-1);
+ Peds.Hhdl = Peds.Hhdl(1:end-1);
+ end
+ end
+return
+
+
+%----------------------------------------------------------------
+function destroy_anim(ghdl)
+%Animates destroying peds
+
+ text_ghdl = get(ghdl,'UserData');
+
+ delete(text_ghdl)
+
+ delete(ghdl);
+
+ drawnow
+return
+
+
+%-------------------------------------------------------------
+function hla_delete(hhdl,lhdl)
+%hla_delete HLA: delete object instance
+
+ tag = ['ped' int2str(lhdl)];
+
+ %DEBUG
+ disp(['delete ' tag]);
+ global LOG
+ fprintf(LOG,'%s\n',['delete ' tag]);
+
+ deleteObjInst(hhdl,tag);
+return
+
+
+%-------------------------------------------------------------
+function time_step
+%Increase simulation time
+
+global T
+
+
+ T.Current = T.Current + T.Step;
+
+% fprintf('t = %d\n',T.Current)
+
+ ped_ts('time_step_anim', T.Current);
+return
+
+
+%-------------------------------------------------------------
+function time_step_anim( t_current )
+%Animates increasing simulation time
+
+global Ghdl
+
+ set(Ghdl.TCurrent,'String',['t = ' int2str(t_current)])
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_leave
+%Leave HLA
+
+ % Resign federation
+ % Aufruf mit Argument: DELETE OBJECTS, weil die Fussgaenger, die sich
+ % bei Simulationsabbruch auf der Strasse befinden nicht durch
+ % destroy_ped->hla_delete->deleteObjInst geloescht werden.
+ e = resignFedExec('d');
+ if ~isempty(e)
+ error(['resignFedExec failed: ' e])
+ end
+return
+
+
+%---------------------------------------------------------------
+function hla_down
+%Destroy federation Traffic-Distr1 and disconnect from RTI
+
+ % Destroy federation
+ e = destroyFedExec('Traffic-Distr1');
+ if ~isempty(e) & ~strcmp(e,'FederatesCurrentlyJoined')
+ error(['destroyFedExec failed: ' e])
+ end
+
+ % Disconnect from RTI
+ rtiOff
+return
+
+
Index: demo/Traffic-Distr1/ped_ts/stopRegForObjClass.m
===================================================================
RCS file: demo/Traffic-Distr1/ped_ts/stopRegForObjClass.m
diff -N demo/Traffic-Distr1/ped_ts/stopRegForObjClass.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/ped_ts/stopRegForObjClass.m 28 Jan 2008 21:46:24
-0000 1.1
@@ -0,0 +1,57 @@
+function stopRegForObjClass(theClass)
+%stopRegForObjClass Stop Registration for Object Class (rti initiated).
+%
+%Synopsis:
+% stopRegForObjClass(theClass)
+%
+%Purpose:
+% To inform the federate that no other federates in the federation
+% execution are subscribed to an object class that it has published.
+
+% throw (
+% ObjectClassNotPublished,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+ped_ts('stopRegForObjClass', theClass)
+
+return
+
+
+%-------------------- default impl. -------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) stopRegForObjClass>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
+
Index: demo/Traffic-Distr1/ped_ts/receiveInteract.m
===================================================================
RCS file: demo/Traffic-Distr1/ped_ts/receiveInteract.m
diff -N demo/Traffic-Distr1/ped_ts/receiveInteract.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/ped_ts/receiveInteract.m 28 Jan 2008 21:46:24
-0000 1.1
@@ -0,0 +1,79 @@
+function receiveInteract(theInteraction,theParameters,in3,in4,in5)
+%receiveInteract Receive Interactions (rti initiated).
+%
+%Synopsis:
+% receiveInteract(theInteraction,theParameters,theTime,theTag,theHandle)
+% receiveInteract(theInteraction,theParameters,theTag)
+%
+%Purpose:
+% Receive interactions sent from remote federates.
+
+% throw ( first method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% InvalidFederationTime,
+% FederateInternalError)
+
+% throw ( second method
+% InteractionClassNotKnown,
+% InteractionParameterNotKnown,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+if (nargin == 5)
+ ped_ts('receiveInteract', ...
+ theInteraction, theParameters, in3, in4, in5)
+else
+ ped_ts('receiveInteract', ...
+ theInteraction, theParameters, in3)
+end
+
+return
+
+
+%---------------------------------------------------------------
+%------------------------- default impl. ------------------------
+if (nargin == 5)
+ theTime = in3;
+ theTag = in4;
+ theHandle = in5;
+ clear in3 in4 in5
+else
+ theTag = in3;
+ clear in3
+end
+
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) receiveInteract>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
Index: demo/Traffic-Distr1/Contents.m
===================================================================
RCS file: demo/Traffic-Distr1/Contents.m
diff -N demo/Traffic-Distr1/Contents.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/Contents.m 28 Jan 2008 21:46:24 -0000 1.1
@@ -0,0 +1,16 @@
+% changed: C.Stenzel, 14.01.2008, English comments
+%
+%Traffic-Distr1
+%
+%
+% car_ts cars - time stepped
+% ped_ts pedestrian - time stepped
+% trl_rt traffic light - real time
+%
+% observ visualisation - without time management
+%
+%
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
Index: demo/Traffic-Distr1/TrafficDistr1.fed
===================================================================
RCS file: demo/Traffic-Distr1/TrafficDistr1.fed
diff -N demo/Traffic-Distr1/TrafficDistr1.fed
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/TrafficDistr1.fed 28 Jan 2008 21:46:25 -0000
1.1
@@ -0,0 +1,222 @@
+;; changed C.Stentel, 14.01.2008, Changed federation name)
+(FED
+ (Federation TrafficDistr1)
+ (FEDversion v1_3)
+ (spaces
+ )
+ (objects
+ (class objectRoot
+ (attribute privilegeToDelete reliable timestamp)
+ (class RTIprivate)
+ (class Manager
+ (class Federate
+ (attribute FederateHandle best_effort receive)
+ (attribute FederateType best_effort receive)
+ (attribute FederateHost best_effort receive)
+ (attribute RTIversion best_effort receive)
+ (attribute FEDid best_effort receive)
+ (attribute TimeConstrained best_effort receive)
+ (attribute TimeRegulating best_effort receive)
+ (attribute AsynchronousDelivery best_effort receive)
+ (attribute FederateState best_effort receive)
+ (attribute TimeManagerState best_effort receive)
+ (attribute FederateTime best_effort receive)
+ (attribute Lookahead best_effort receive)
+ (attribute LBTS best_effort receive)
+ (attribute MinNextEventTime best_effort receive)
+ (attribute ROlength best_effort receive)
+ (attribute TSOlength best_effort receive)
+ (attribute ReflectionsReceived best_effort receive)
+ (attribute UpdatesSent best_effort receive)
+ (attribute InteractionsReceived best_effort receive)
+ (attribute InteractionsSent best_effort receive)
+ (attribute ObjectsOwned best_effort receive)
+ (attribute ObjectsUpdated best_effort receive)
+ (attribute ObjectsReflected best_effort receive) )
+ (class Federation
+ (attribute FederationName best_effort receive)
+ (attribute FederatesInFederation best_effort receive)
+ (attribute RTIversion best_effort receive)
+ (attribute FEDid best_effort receive)
+ (attribute LastSaveName best_effort receive)
+ (attribute LastSaveTime best_effort receive)
+ (attribute NextSaveName best_effort receive)
+ (attribute NextSaveTime best_effort receive) )
+ )
+;; user object classes here
+ (class Car
+ (attribute Pos reliable timestamp)
+ )
+ (class Ped
+ (attribute Pos reliable timestamp)
+ )
+ )
+ )
+ (interactions
+ (class interactionRoot best_effort receive
+ (class RTIprivate best_effort receive)
+ (class Manager best_effort receive
+ (class Federate best_effort receive
+ (parameter Federate)
+ (class Adjust best_effort receive
+ (class SetTiming best_effort receive
+ (parameter ReportPeriod) )
+ (class ModifyAttributeState best_effort receive
+ (parameter ObjectInstance)
+ (parameter Attribute)
+ (parameter AttributeState) )
+ (class SetServiceReporting best_effort receive
+ (parameter ReportingState) )
+ (class SetExceptionLogging best_effort receive
+ (parameter LoggingState) )
+ )
+ (class Request best_effort receive
+ (class RequestPublications best_effort receive)
+ (class RequestSubscriptions best_effort receive)
+ (class RequestObjectsOwned best_effort receive)
+ (class RequestObjectsUpdated best_effort receive)
+ (class RequestObjectsReflected best_effort receive)
+ (class RequestUpdatesSent best_effort receive)
+ (class RequestInteractionsSent best_effort receive)
+ (class RequestReflectionsReceived best_effort receive)
+ (class RequestInteractionsReceived best_effort receive)
+ (class RequestObjectInformation best_effort receive
+ (parameter ObjectInstance) )
+ )
+ (class Report best_effort receive
+ (class ReportObjectPublication best_effort receive
+ (parameter NumberOfClasses)
+ (parameter ObjectClass)
+ (parameter AttributeList) )
+ (class ReportInteractionPublication best_effort receive
+ (parameter InteractionClassList) )
+ (class ReportObjectSubscription best_effort receive
+ (parameter NumberOfClasses)
+ (parameter ObjectClass)
+ (parameter AttributeList)
+ (parameter Active) )
+ (class ReportInteractionSubscription best_effort receive
+ (parameter InteractionClassList) )
+ (class ReportObjectsOwned best_effort receive
+ (parameter ObjectCounts) )
+ (class ReportObjectsUpdated best_effort receive
+ (parameter ObjectCounts) )
+ (class ReportObjectsReflected best_effort receive
+ (parameter ObjectCounts) )
+ (class ReportUpdatesSent best_effort receive
+ (parameter TransportationType)
+ (parameter UpdateCounts) )
+ (class ReportReflectionsReceived best_effort receive
+ (parameter TransportationType)
+ (parameter ReflectCounts) )
+ (class ReportInteractionsSent best_effort receive
+ (parameter TransportationType)
+ (parameter InteractionCounts) )
+ (class ReportInteractionsReceived best_effort receive
+ (parameter TransportationType)
+ (parameter InteractionCounts) )
+ (class ReportObjectInformation best_effort receive
+ (parameter ObjectInstance)
+ (parameter OwnedAttributeList)
+ (parameter RegisteredClass)
+ (parameter KnownClass) )
+ (class Alert best_effort receive
+ (parameter AlertSeverity)
+ (parameter AlertDescription)
+ (parameter AlertID) )
+ (class ReportServiceInvocation best_effort receive
+ (parameter Service)
+ (parameter Initiator)
+ (parameter SuccessIndicator)
+ (parameter SuppliedArgument1)
+ (parameter SuppliedArgument2)
+ (parameter SuppliedArgument3)
+ (parameter SuppliedArgument4)
+ (parameter SuppliedArgument5)
+ (parameter ReturnedArgument)
+ (parameter ExceptionDescription)
+ (parameter ExceptionID) )
+ )
+ (class Service best_effort receive
+ (class ResignFederationExecution best_effort receive
+ (parameter ResignAction) )
+ (class SynchronizationPointAchieved best_effort receive
+ (parameter Label) )
+ (class FederateSaveBegun best_effort receive)
+ (class FederateSaveComplete best_effort receive
+ (parameter SuccessIndicator) )
+ (class FederateRestoreComplete best_effort receive
+ (parameter SuccessIndicator) )
+ (class PublishObjectClass best_effort receive
+ (parameter ObjectClass)
+ (parameter AttributeList) )
+ (class UnpublishObjectClass best_effort receive
+ (parameter ObjectClass) )
+ (class PublishInteractionClass best_effort receive
+ (parameter InteractionClass) )
+ (class UnpublishInteractionClass best_effort receive
+ (parameter InteractionClass) )
+ (class SubscribeObjectClassAttributes best_effort receive
+ (parameter ObjectClass)
+ (parameter AttributeList)
+ (parameter Active) )
+ (class UnsubscribeObjectClass best_effort receive
+ (parameter ObjectClass) )
+ (class SubscribeInteractionClass best_effort receive
+ (parameter InteractionClass)
+ (parameter Active) )
+ (class UnsubscribeInteractionClass best_effort receive
+ (parameter InteractionClass) )
+ (class DeleteObjectInstance best_effort receive
+ (parameter ObjectInstance)
+ (parameter FederationTime)
+ (parameter Tag) )
+ (class LocalDeleteObjectInstance best_effort receive
+ (parameter ObjectInstance) )
+ (class ChangeAttributeTransportationType best_effort receive
+ (parameter ObjectInstance)
+ (parameter AttributeList)
+ (parameter TransportationType) )
+ (class ChangeAttributeOrderType best_effort receive
+ (parameter ObjectInstance)
+ (parameter AttributeList)
+ (parameter OrderingType) )
+ (class ChangeInteractionTransportationType best_effort receive
+ (parameter InteractionClass)
+ (parameter TransportationType) )
+ (class ChangeInteractionOrderType best_effort receive
+ (parameter InteractionClass)
+ (parameter OrderingType) )
+ (class UnconditionalAttributeOwnershipDivestiture best_effort
receive
+ (parameter ObjectInstance)
+ (parameter AttributeList) )
+ (class EnableTimeRegulation best_effort receive
+ (parameter FederationTime)
+ (parameter Lookahead) )
+ (class DisableTimeRegulation best_effort receive)
+ (class EnableTimeConstrained best_effort receive)
+ (class DisableTimeConstrained best_effort receive)
+ (class EnableAsynchronousDelivery best_effort receive)
+ (class DisableAsynchronousDelivery best_effort receive)
+ (class ModifyLookahead best_effort receive
+ (parameter Lookahead) )
+ (class TimeAdvanceRequest best_effort receive
+ (parameter FederationTime) )
+ (class TimeAdvanceRequestAvailable best_effort receive
+ (parameter FederationTime) )
+ (class NextEventRequest best_effort receive
+ (parameter FederationTime) )
+ (class NextEventRequestAvailable best_effort receive
+ (parameter FederationTime) )
+ (class FlushQueueRequest best_effort receive
+ (parameter FederationTime) )
+ )
+ )
+ )
+;; user interaction classes here
+ (class Trl reliable timestamp
+ (parameter Event)
+ )
+ )
+ )
+)
Index: demo/Traffic-Distr1/trl_rt/trl_rt.m
===================================================================
RCS file: demo/Traffic-Distr1/trl_rt/trl_rt.m
diff -N demo/Traffic-Distr1/trl_rt/trl_rt.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/trl_rt/trl_rt.m 28 Jan 2008 21:46:25 -0000 1.1
@@ -0,0 +1,466 @@
+function varargout = trl_rt(varargin)
+%trl_rt Real-Time Simulation of Traffic-Light / HLA
+
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+% switchboard for local sub-functions
+if nargin > 0
+ [varargout{1:nargout}] = feval(varargin{:});
+ return
+end
+
+
+% main function
+%DEBUG
+global LOG
+ LOG=fopen('log.txt','w');
+
+global T
+ T.Current = trl_rt('wallclock'); % start and current time
+ T.NextEvent = []; % time of next event
+ T.Terminate = 0; % termination flag; set to 1
+ % by trl_rt('terminate_Callback')
+ T.Continue = 1; % continuation flag; set to
+ % 0 by trl_rt('stop_Callback')
+ % 1 by trl_rt('cont_Callback')
+
+global EL % event list
+ EL.Time = []; % event time
+ EL.Event = []; % event
+
+
+ trl_rt('init') % model init
+
+ trl_rt('hla_join') % join hla
+
+ trl_rt('loop') % simulation loop
+
+ trl_rt('hla_leave') % leave hla
+
+ trl_rt('hla_down') % terminate hla
+return
+
+
+%--------------------------------------------------------------------
+function t = wallclock
+%Returns wallclock time
+
+ t = clock;
+ t = t(4) * 3600 + t(5) * 60 + t(6);
+return
+
+
+%--------------------------------------------------------------------
+function terminate_Callback
+%Set termination flag to 1
+
+global T
+
+ T.Terminate = 1;
+return
+
+
+%--------------------------------------------------------------------
+function stop_Callback
+%Set continue flag to 0
+
+global T
+
+ T.Continue = 0;
+return
+
+
+%--------------------------------------------------------------------
+function cont_Callback
+%Set continue flag to 1
+
+global T
+
+ T.Continue = 1;
+return
+
+
+%--------------------------------------------------------------------
+function init
+%Model initialization
+
+global T EL
+
+global Trl
+ Trl.NextLhdl = 1; % next local handle
+ Trl.CarGreenTime = 10; % green duration for cars
+ Trl.PedGreenTime = 5; % green duration for peds
+
+ EL.Time = [T.Current EL.Time]; % plan initial event
+ EL.Event = ['c' EL.Event];
+
+ trl_rt('init_anim')
+return
+
+
+%---------------------------------------------------------------
+function init_anim
+%Animation initialization
+
+ clf reset
+ cax = newplot;
+
+ set(get(cax,'Parent'), ... % figure properties
+ 'Name','trl_rt', ...
+ 'NumberTitle','off', ...
+ 'DoubleBuffer','on', ... % ???, sonst Flimmern
+ 'BackingStore','off', ...
+ 'Colormap',[]);
+
+ set(cax, ... % axes properties
+ 'Visible','off', ...
+ 'Drawmode','Fast',...
+ 'NextPlot','add');
+ axis([0 20 0 20]); % 'Position'
+
+ plot([0 20],[11, 11],'k') % street for cars
+ plot([0 20],[ 9, 9],'k')
+ plot(9,9.3,'ko') % traffic light for cars
+
+ plot([ 9, 9],[0 20],'k') % path for peds
+ plot([11, 11],[0 20],'k')
+ plot(10.7,9,'ko') % traffic light for peds
+
+global Ghdl
+ Ghdl.TCurrent = text( 1,18,'tc = ');
+ Ghdl.TNextEvent = text( 1,17,'tn = ');
+ Ghdl.Event = text(12,18,'event: ');
+
+ uicontrol('String','Quit', ...
+ 'Callback','trl_rt(''terminate_Callback'')');
+
+ uicontrol('String','Stop', ...
+ 'Callback','trl_rt(''stop_Callback'')', ...
+ 'Position',[130 20 60 20]);
+
+ uicontrol('String','Cont', ...
+ 'Callback','trl_rt(''cont_Callback'')', ...
+ 'Position',[330 20 60 20]);
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_join
+%Join HLA
+
+global HLA
+ HLA.RttTrl = []; % HLA run-time-type for trl event class
+ HLA.RttTrlEvent = []; % HLA run-time-type for trl event parameter
+
+
+ % Connect to RTI
+ rtiOn
+
+ % Create federation
+ e = createFedExec('Traffic-Distr1','TrafficDistr1.fed');
+ if ~isempty(e) & ~strcmp(e,'FederationExecutionAlreadyExists')
+ error(['createFedExec failed: ' e])
+ end
+
+ % Join federation
+ e = 'FederationExecutionDoesNotExist';
+ while strcmp(e,'FederationExecutionDoesNotExist')
+ [federateId, e] = joinFedExec('trl_rt','Traffic-Distr1');
+ pause(1)
+ end
+ if ~isempty(e)
+ error(['joinFedExec failed: ' e])
+ end
+
+ % RTT identification
+ HLA.RttTrl = getInteractClassHdl('Trl');
+ HLA.RttTrlEvent = getParamHdl( 'Event', HLA.RttTrl);
+
+ % Publish Trl
+ publishInteractClass(HLA.RttTrl);
+ % Wenn durch ein anderes Federate subscribeInteractClass()
+ % aufgerufen wird, erhaelt dieses Federate den turnInteractOn()
+ % Callback.
+ % Dieser Informationsmechanismus koennte hier mit
+ % disableInteractionRelevanceAdvisorySwitch() abgeschaltet werden.
+ % Hier wurde aber nur der turnInteractOff() Callback als
+ % Nop implementiert.
+ % Analoges gilt fuer turnInteractOff()
+return
+
+
+%---------------------------------------------------------------
+function turnInteractOn(theHandle)
+%Invoked by RTI to inform the federate that other federates have subscribed
+%to a published interaction class.
+
+disp('(trl_rt) turnInteractOn>> ... no operation');
+
+return
+
+
+%---------------------------------------------------------------
+function turnInteractOff(theHandle)
+%Invoked by RTI to inform the federate that no longer any other federate
+%has subscribed to a published interaction class.
+%turnInteractOff Turn Interactions Off (rti initiated).
+
+disp('(trl_rt) turnInteractOff>> ... no operation');
+
+return
+
+
+%---------------------------------------------------------------
+function loop
+%trl_rt loop
+
+global T
+
+
+ while ~T.Terminate % simulation loop
+
+ [trash,e] = tick; if ~isempty(e), error(e), end
+
+ trl_rt('next_event_time')
+
+ trl_rt('process_events')
+
+ trl_rt('rt_sync')
+
+ if T.Continue == 0
+ while T.Continue == 0
+ drawnow % stop
+ end
+ end
+ end
+return
+
+
+%------------------------------------------------------------------
+function next_event_time
+%Determines next event time
+
+global T EL
+
+
+ T.NextEvent = EL.Time(1);
+
+ trl_rt('next_event_time_anim', T.NextEvent )
+return
+
+
+%---------------------------------------------------------------
+function next_event_time_anim( t )
+%Animates next event time
+
+global Ghdl
+
+ h = fix(t/3600); t = t - 3600 * h;
+ m = fix(t/60); t = t - 60 * m;
+ s = fix(t);
+ t_str = [int2str(h) ':' ...
+ int2str(m) ' ' ...
+ int2str(s) ];
+
+% fprintf('tn = %s\n',t_str)
+
+ set(Ghdl.TNextEvent,'String',['tn = ' t_str])
+
+ drawnow
+return
+
+
+%------------------------------------------------------------------
+function process_events
+%Process next events
+
+global T EL
+
+ if T.Current >= T.NextEvent
+
+ event = EL.Event(1);
+
+ EL.Time = EL.Time(2:end);
+ EL.Event = EL.Event(2:end);
+
+ switch event
+ case abs('c'), trl_rt('car_green')
+ case abs('p'), trl_rt('ped_green')
+ otherwise, error('Unknown event.')
+ end
+ end
+return
+
+
+%------------------------------------------------------------------
+function car_green
+%Switch traffic ligth to car green
+
+global T EL Trl
+
+ lhdl = Trl.NextLhdl;
+ Trl.NextLhdl = Trl.NextLhdl + 1;
+
+ trl_rt('car_green_anim', lhdl)
+
+ trl_rt('hla_send', lhdl, 'c')
+
+ EL.Time(1) = [T.Current+Trl.CarGreenTime EL.Time]; % plan next event
+ EL.Event(1) = ['p' EL.Event];
+return
+
+
+%-------------------------------------------------------------
+function car_green_anim(lhdl)
+%Animates switching traffic ligth to car green
+
+global Ghdl
+
+ set(Ghdl.Event,'String',['event: c ' int2str(lhdl)])
+
+ plot( 9.0,9.3,'g*') % green for cars
+ plot(10.7,9.0,'r*') % red for peds
+
+ drawnow
+return
+
+
+%------------------------------------------------------------------
+function ped_green
+%Switch traffic ligth to ped green
+
+global T EL Trl
+
+ lhdl = Trl.NextLhdl;
+ Trl.NextLhdl = Trl.NextLhdl + 1;
+
+ trl_rt('ped_green_anim', lhdl)
+
+ trl_rt('hla_send', lhdl, 'p')
+
+ EL.Time(1) = [T.Current+Trl.PedGreenTime EL.Time]; % plan next event
+ EL.Event(1) = ['c' EL.Event];
+return
+
+
+%---------------------------------------------------------------
+function ped_green_anim(lhdl)
+%Animates switching traffic ligth to ped green
+
+global Ghdl
+
+ set(Ghdl.Event,'String',['event: p ' int2str(lhdl)])
+
+ plot( 9.0,9.3,'r*') % red for cars
+ plot(10.7,9.0,'g*') % green for peds
+
+ drawnow
+return
+
+
+%----------------------------------------------------------------
+function hla_send(lhdl,event)
+%hla_send
+
+global HLA
+
+ tag = ['trl ' event int2str(lhdl)];
+
+ %DEBUG
+ disp(['send ' tag])
+ global LOG
+ fprintf(LOG,'%s\n',['send ' tag]);
+
+ sendInteract( HLA.RttTrl, ...
+ {HLA.RttTrlEvent, char2net(event)}, ...
+ tag);
+return
+
+
+%----------------------------------------------------------------
+function rt_sync
+%Synchronize with real-time
+
+global T
+
+ t = wallclock;
+ rt_diff = T.Current - t;
+ T.Current = t;
+
+ trl_rt('rt_sync_anim', T.Current, rt_diff )
+return
+
+
+%-------------------------------------------------------------
+function rt_sync_anim( t_current, rt_diff )
+%Animates synchronization with real-time
+
+global Ghdl
+
+ t = t_current; % wallclock time
+ h = fix(t/3600); t = t - 3600 * h;
+ m = fix(t/60); t = t - 60 * m;
+ s = fix(t);
+ t_str = [int2str(h) ':' ...
+ int2str(m) ' ' ...
+ int2str(s) ];
+
+ diff_str = sprintf('%1.1f',rt_diff); % delay against wallclock time
+
+% fprintf('t = %s RTdiff = %s\n',t_str,diff_str);
+
+ set(Ghdl.TCurrent,'String',['tc = ' t_str ' RTdiff = '
diff_str])
+
+ drawnow
+return
+
+
+%---------------------------------------------------------------
+function hla_leave
+%Leave HLA
+
+ % Resign federation
+ e = resignFedExec('');
+ if ~isempty(e)
+ error(['resignFedExec failed: ' e])
+ end
+return
+
+
+%---------------------------------------------------------------
+function hla_down
+%Destroy federation Traffic-Distr1 and disconnect from RTI
+
+ % Destroy federation
+ e = destroyFedExec('Traffic-Distr1');
+ if ~isempty(e) & ~strcmp(e,'FederatesCurrentlyJoined')
+ error(['destroyFedExec failed: ' e])
+ end
+
+ % Disconnect from RTI
+ rtiOff
+return
+
+
Index: demo/Traffic-Distr1/trl_rt/turnInteractOff.m
===================================================================
RCS file: demo/Traffic-Distr1/trl_rt/turnInteractOff.m
diff -N demo/Traffic-Distr1/trl_rt/turnInteractOff.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/trl_rt/turnInteractOff.m 28 Jan 2008 21:46:25
-0000 1.1
@@ -0,0 +1,57 @@
+function turnInteractOff(theHandle)
+%turnInteractOff Turn Interactions Off (rti initiated).
+%
+%Synopsis:
+% turnInteractOff(theHandle)
+%
+%Purpose:
+% To inform the federate that no other federates in the federation
+% execution are subscribed to an interaction class that it has
+% published.
+
+% throw (
+% InteractionClassNotPublished,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+trl_rt('turnInteractOff', theHandle)
+
+return
+
+
+%-------------------- default impl. -------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) turnInteractOff>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
Index: demo/Traffic-Distr1/trl_rt/turnInteractOn.m
===================================================================
RCS file: demo/Traffic-Distr1/trl_rt/turnInteractOn.m
diff -N demo/Traffic-Distr1/trl_rt/turnInteractOn.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/Traffic-Distr1/trl_rt/turnInteractOn.m 28 Jan 2008 21:46:25 -0000
1.1
@@ -0,0 +1,57 @@
+function turnInteractOn(theHandle)
+%turnInteractOn Turn Interactions on (rti initiated).
+%
+%Synopsis:
+% turnInteractOn(theHandle)
+%
+%Purpose:
+% To inform the federate that other federates in the federation
+% execution have subscribed to an interaction class that it has
+% published.
+
+% throw (
+% InteractionClassNotPublished,
+% FederateInternalError)
+
+% Copyright (c) 1998-2000 University of Rostock, Germany,
+% Institute of Automatic Control. All rights reserved.
+% Author: S. Pawletta
+
+% This file is part of MatlabHLA13 demo applications.
+%
+% This demo is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public
+% License as published by the Free Software Foundation, either
+% version 3 of the License, or (at your option) any later version.
+%
+% This demo is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public
+% License along with this demo.
+%
+% If not, see <http://www.gnu.org/licenses/>.
+
+
+trl_rt('turnInteractOn', theHandle)
+
+return
+
+
+%-------------------- default impl. -------------------------
+cmd='';
+
+while ~strcmp(cmd,'return')
+ cmd = input('(NULL) turnInteractOn>> ','s');
+ eval(cmd,'error_handler')
+end
+
+return
+
+
+function error_handler()
+ disp(lasterr)
+return
+
Index: rti/rti.cpp
===================================================================
RCS file: rti/rti.cpp
diff -N rti/rti.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ rti/rti.cpp 28 Jan 2008 21:46:25 -0000 1.1
@@ -0,0 +1,3487 @@
+/*
+ Copyright (C) 2008 Christian Stenzel, Sven Pawletta, Thorsten Pawletta
+
+ This file is part of MatlabHLA13.
+
+ MatlabHLA13 is free software: you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation, either
+ version 3 of the License, or (at your option) any later version.
+
+ MatlabHLA13 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with MatlabHLA13.
+
+ If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/******************************************************************************/
+/*
+ * Matlab/RTI/Matlab - Interface
+ *
+ * Authors: C. Stenzel, S. Pawletta
+ *
+ */
+
+#include <cstdio>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <math.h>
+#include <iostream>
+#include <exception>
+#include <arpa/inet.h>
+
+#include "mex.h"
+
+#include "RTI.hh"
+#include "NullFederateAmbassador.hh"
+#include "fedtime.hh"
+
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
+extern "C" void SignalHandler(int Signal);
+
+using std::string ;
+using std::cout ;
+using std::endl ;
+using std::cerr ;
+
+/*********************************************************
+ * Conversions: Data Representations: Matlab <-> Network *
+ *********************************************************/
+
+static void
+double2net(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ double dval;
+ int dims[2];
+
+ dval = mxGetPr(prhs[0])[0];
+
+#if defined(_X86_) || defined(i386)
+ double tmp;
+ *((long*)&tmp) = htonl(*(((long*)&dval) + 1));
+ *(((long*)&tmp) + 1) = htonl(*((long*)&dval));
+ dval = tmp;
+#elif defined(__alpha)
+ double tmp;
+ cvt_ftof(&dval, CVT_BIG_ENDIAN_IEEE_T, &tmp, CVT_IEEE_T, 0);
+ dval = tmp;
+#endif
+
+ dims[0] = sizeof(double);
+ dims[1] = 1;
+
+ plhs[0] = mxCreateNumericArray(2, dims, mxINT8_CLASS, mxREAL);
+
+ memcpy(mxGetPr(plhs[0]), &dval, dims[0]);
+
+ return;
+}
+
+
+static void
+net2double(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ double dval;
+
+ memcpy(&dval, mxGetPr(prhs[0]), mxGetM(prhs[0]));
+
+#if defined(_X86_) || defined(i386)
+ long x = ntohl(*(long*)&dval);
+ *(long*)&dval = ntohl(* (((long*)&dval) + 1));
+ *(((long*)&dval)+1) = x;
+#elif defined(__alpha)
+ double x;
+ cvt_ftof(&dval, CVT_IEEE_T, &x, CVT_BIG_ENDIAN_IEEE_T, 0);
+ dval = x;
+#endif
+
+ plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
+
+ mxGetPr(plhs[0])[0] = dval;
+
+ return;
+}
+
+
+static void
+char2net(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ int dims[2];
+
+ dims[0] = (mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
+ dims[1] = 1;
+
+ plhs[0] = mxCreateNumericArray(2, dims, mxINT8_CLASS, mxREAL);
+
+ mxGetString(prhs[0], (char*)mxGetData(plhs[0]), dims[0]);
+
+ return;
+}
+
+
+static void
+net2char(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ const char *strings[1];
+
+ strings[0] = (char*) mxGetData(prhs[0]);
+ plhs[0] = mxCreateCharMatrixFromStrings(1, strings);
+
+ return;
+}
+
+
+/******************************************
+ * Conversions: RTI Types: Matlab <-> C++ *
+ ******************************************/
+
+static char * // returned
+mstr2cstr(const mxArray *mstr) { // supplied
+
+ char *cstr;
+
+ int strl;
+
+
+ strl = (mxGetM(mstr) * mxGetN(mstr)) + 1;
+
+ cstr = (char*) mxCalloc(strl, sizeof(char));
+
+ mxGetString(mstr, cstr, strl);
+
+ return cstr;
+}
+
+
+static void
+free_cstr(char *cstr) { // supplied
+
+ mxFree( (void*) cstr);
+
+ return;
+}
+
+
+static mxArray* // returned
+cstr2mstr(const char *cstr) { // supplied
+
+ return mxCreateString(cstr);
+}
+
+
+static RTI::Boolean // returned
+mscalar2bool(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::Boolean) (int) mxGetScalar(mscalar) );
+}
+
+
+static mxArray*
+bool2mscalar(const RTI::Boolean boolVal) { //
supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) boolVal;
+
+ return mscalar;
+}
+
+
+static RTI::ResignAction // returned
+mstr2resignAction(const mxArray *mstr) { // supplied
+
+ char str[2];
+
+
+ if ( mxIsEmpty(mstr) ) {
+ return RTI::NO_ACTION;
+ }
+
+ if ( (mxGetM(mstr)*mxGetN(mstr)) > 1 ) {
+ return RTI::DELETE_OBJECTS_AND_RELEASE_ATTRIBUTES;
+ }
+
+ mxGetString(mstr, str, 2);
+
+ if ( str[0] == 'd' ) {
+ return RTI::DELETE_OBJECTS;
+ }
+
+ return RTI::RELEASE_ATTRIBUTES;
+}
+
+
+
+static RTI::ObjectClassHandle // returned
+mscalar2objClassHdl(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::ObjectClassHandle) mxGetScalar(mscalar) );
+}
+
+
+static mxArray*
+objClassHdl2mscalar(const RTI::ObjectClassHandle objClassHdl) { //
supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) objClassHdl;
+
+ return mscalar;
+}
+
+
+static RTI::InteractionClassHandle // returned
+mscalar2interactClassHdl(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::InteractionClassHandle) mxGetScalar(mscalar) );
+}
+
+
+static mxArray*
+interactClassHdl2mscalar(const RTI::InteractionClassHandle interactClassHdl) {
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) interactClassHdl;
+
+ return mscalar;
+}
+
+
+static mxArray*
+federateHdl2mscalar(const RTI::FederateHandle federateHdl) { // supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) federateHdl;
+
+ return mscalar;
+}
+
+
+static mxArray*
+attrHdl2mscalar(const RTI::AttributeHandle attrHdl) { // supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) attrHdl;
+
+ return mscalar;
+}
+
+static mxArray*
+transHdl2mscalar(const RTI::TransportationHandle transHdl) { //
supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) transHdl;
+
+ return mscalar;
+}
+
+static RTI::TransportationHandle //
returned
+mscalar2TransHdl(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::TransportationHandle) mxGetScalar(mscalar) );
+}
+
+static mxArray*
+orderHdl2mscalar(const RTI::OrderingHandle orderHdl) { // supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) orderHdl;
+
+ return mscalar;
+}
+
+static RTI::OrderingHandle // returned
+mscalar2orderHdl(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::OrderingHandle) mxGetScalar(mscalar) );
+}
+
+
+
+static mxArray*
+paramHdl2mscalar(const RTI::ParameterHandle paramHdl) { //
supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) paramHdl;
+
+ return mscalar;
+}
+
+
+static RTI::ObjectHandle // returned
+mscalar2objHdl(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::ObjectHandle) mxGetScalar(mscalar) );
+}
+
+
+static mxArray*
+objHdl2mscalar(const RTI::ObjectHandle objHdl) { // supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1,1,mxREAL);
+ mxGetPr(mscalar)[0] = (double) objHdl;
+
+ return mscalar;
+}
+
+
+
+static RTI::TickTime // returned
+mscalar2tickTime(const mxArray *mscalar) { // supplied
+
+ return ( (RTI::TickTime) mxGetScalar(mscalar) );
+}
+
+
+
+static RTI::FederateHandleSet*
+mvec2federateHdlSet(const mxArray *mvec) { // supplied
+
+ RTI::FederateHandleSet *federateHdlSet; // returned
+
+ int count, i;
+ RTI::FederateHandle h;
+
+
+ count = mxGetM(mvec) * mxGetN(mvec);
+
+ try {
+ federateHdlSet = RTI::FederateHandleSetFactory::create(count);
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mvec2attrHdlSet(): \
+ FederateHandleSetFactory::create() failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+
+ for (i=0; i<count; i++) {
+ h = (RTI::FederateHandle) (mxGetPr(mvec)[i]);
+ try {
+ federateHdlSet->add(h);
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mvec2federateHdlSet(): \
+ FederateHandleSetFactory::add() \
+ failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+ }
+
+ return federateHdlSet;
+}
+
+
+static void
+free_federateHdlSet(RTI::FederateHandleSet *federateHdlSet) { //
supplied
+
+ federateHdlSet->empty();
+ delete federateHdlSet;
+
+ return;
+}
+
+
+
+static mxArray*
+federateHdlSet2mvec(const RTI::FederateHandleSet &federateHdlSet) { //
supplied
+
+ mxArray *mvec; // returned
+
+ int count, i;
+ RTI::FederateHandle h;
+
+
+ count = federateHdlSet.size();
+
+ mvec = mxCreateDoubleMatrix(count,1,mxREAL);
+
+ for (i=0; i<count; i++) {
+ h = federateHdlSet.getHandle(i);
+ mxGetPr(mvec)[i] = (double) h;
+ }
+
+ return mvec;
+}
+
+
+static RTI::AttributeHandleSet*
+mvec2attrHdlSet(const mxArray *mvec) { // supplied
+
+ RTI::AttributeHandleSet *attrHdlSet; // returned
+
+ int count, i;
+ RTI::AttributeHandle h;
+
+
+ count = mxGetM(mvec) * mxGetN(mvec);
+
+ try {
+ attrHdlSet = RTI::AttributeHandleSetFactory::create(count);
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mvec2attrHdlSet(): \
+ AttributeHandleSetFactory::create() failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+
+ for (i=0; i<count; i++) {
+ h = (RTI::AttributeHandle) (mxGetPr(mvec)[i]);
+ try {
+ attrHdlSet->add(h);
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mvec2attrHdlSet(): \
+ AttributeHandleSetFactory::add() \
+ failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+ }
+
+ return attrHdlSet;
+}
+
+
+static void
+free_attrHdlSet(RTI::AttributeHandleSet *attrHdlSet) { // supplied
+
+ attrHdlSet->empty();
+ delete attrHdlSet;
+
+ return;
+}
+
+
+static mxArray*
+attrHdlSet2mvec(const RTI::AttributeHandleSet &attrHdlSet) { // supplied
+
+ mxArray *mvec; // returned
+
+ int count, i;
+ RTI::AttributeHandle h;
+
+
+ count = attrHdlSet.size();
+
+ mvec = mxCreateDoubleMatrix(count,1,mxREAL);
+
+ for (i=0; i<count; i++) {
+ h = attrHdlSet.getHandle(i);
+ mxGetPr(mvec)[i] = (double) h;
+ }
+
+ return mvec;
+}
+
+
+static RTI::AttributeHandleValuePairSet*
+mcell2attrHdlValPairSet(const mxArray *mcell) { //
supplied
+
+ RTI::AttributeHandleValuePairSet *ahvps; // returned
+
+ int count, i;
+ RTI::AttributeHandle h;
+ mxArray *hdl, *val;
+
+
+ count = mxGetM(mcell);
+
+ try {
+ ahvps = RTI::AttributeSetFactory::create(count);
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mcell2attrHdlValPairSet(): \
+ AttributeSetFactory::create() failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+
+ for (i=0; i<count; i++) {
+
+ hdl = mxGetCell(mcell,i); // column-ordering; 1st col
+ if (!hdl) {
+ // no handle cell contained
+ continue;
+ }
+ if (mxIsEmpty(hdl)) {
+ // empty handle cell
+ continue;
+ }
+ h = (RTI::AttributeHandle) (mxGetPr(hdl)[0]);
+
+ val = mxGetCell(mcell,count+i); // column-ordering; 2ed col
+ try {
+ ahvps->add(h,
+ (char*)mxGetData(val),
+ mxGetNumberOfElements(val));
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mcell2attrHdlValPairSet(): \
+ AttributeHandleValuePairSet::add() \
+ failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+ }
+
+ return ahvps;
+}
+
+
+static void
+free_attrHdlValPairSet(RTI::AttributeHandleValuePairSet *ahvps) { //
supplied
+
+ ahvps->empty();
+ delete ahvps;
+
+ return;
+}
+
+
+static mxArray*
+attrHdlValPairSet2mcell(const RTI::AttributeHandleValuePairSet &ahvps) { //
sup.
+
+ mxArray *mcell; // returned
+
+ int count, i;
+ mxArray *hdl,*val;
+ int dims[2];
+ RTI::ULong trash;
+
+
+ count = ahvps.size();
+
+ mcell = mxCreateCellMatrix(count, 2);
+
+ for (i=0; i<count; i++) {
+
+ hdl = mxCreateDoubleMatrix(1, 1, mxREAL);
+ mxGetPr(hdl)[0] = ahvps.getHandle(i);
+ mxSetCell(mcell, i, hdl); // column-ordering; 1st col.
+
+ dims[0] = ahvps.getValueLength(i);
+ dims[1] = 1;
+ val = mxCreateNumericArray(2, dims, mxINT8_CLASS, mxREAL);
+ ahvps.getValue(i, (char*)mxGetData(val), trash);
+ mxSetCell(mcell, count+i, val); // column-ordering; 2ed col.
+ }
+
+ return mcell;
+}
+
+
+static RTI::ParameterHandleValuePairSet*
+mcell2paramHdlValPairSet(const mxArray *mcell) { // supplied
+
+ RTI::ParameterHandleValuePairSet *phvps; // returned
+
+ int count, i;
+ RTI::ParameterHandle h;
+ mxArray *hdl, *val;
+
+
+ count = mxGetM(mcell);
+
+ try {
+ phvps = RTI::ParameterSetFactory::create(count);
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mcell2paramHdlValPairSet(): \
+ ParameterSetFactory::create() failed.");
+
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+
+ for (i=0; i<count; i++) {
+
+ hdl = mxGetCell(mcell,i); // column-ordering; 1st col
+ if (!hdl) {
+ // no handle cell contained
+ continue;
+ }
+ if (mxIsEmpty(hdl)) {
+ // empty handle cell
+ continue;
+ }
+ h = (RTI::ParameterHandle) (mxGetPr(hdl)[0]);
+
+ val = mxGetCell(mcell,count+i); // column-ordering; 2ed col
+ try {
+ phvps->add(h,
+ (char*)mxGetData(val),
+ mxGetNumberOfElements(val));
+ }
+ catch (RTI::Exception& e) {
+ cout << "Exception: " << &e << endl;
+ mexErrMsgTxt("mcell2paramHdlValPairSet(): \
+ ParameterHandleValuePairSet::add() \
+ failed.");
+ }
+ catch (...) {
+ printf("caught unknown exception");
+ }
+
+
+ }
+
+ return phvps;
+}
+
+
+static void
+free_paramHdlValPairSet(RTI::ParameterHandleValuePairSet *phvps) { // supplied
+
+ phvps->empty();
+ delete phvps;
+
+ return;
+}
+
+
+static mxArray*
+paramHdlValPairSet2mcell(const RTI::ParameterHandleValuePairSet &phvps) {//
sup.
+
+ mxArray *mcell; // returned
+
+ int count, i;
+ mxArray *hdl,*val;
+ int dims[2];
+ RTI::ULong trash;
+
+
+ count = phvps.size();
+
+ mcell = mxCreateCellMatrix(count, 2);
+
+ for (i=0; i<count; i++) {
+
+ hdl = mxCreateDoubleMatrix(1, 1, mxREAL);
+ mxGetPr(hdl)[0] = phvps.getHandle(i);
+ mxSetCell(mcell, i, hdl); // column-ordering; 1st col.
+
+ dims[0] = phvps.getValueLength(i);
+ dims[1] = 1;
+ val = mxCreateNumericArray(2, dims, mxINT8_CLASS, mxREAL);
+ phvps.getValue(i, (char*)mxGetData(val), trash);
+ mxSetCell(mcell, count+i, val); // column-ordering; 2ed col.
+ }
+
+ return mcell;
+}
+
+
+static RTIfedTime*
+mscalar2fedTime(const mxArray *mscalar) { // supplied
+
+ RTIfedTime *theTime; // returned
+
+
+ theTime = new RTIfedTime( mxGetScalar(mscalar) );
+
+ return theTime;
+}
+
+
+static void
+free_fedTime(RTIfedTime *theTime) { // supplied
+
+ delete theTime;
+
+ return;
+}
+
+
+static mxArray*
+fedTime2mscalar(const RTI::FedTime &theTime) { // supplied
+
+ mxArray *mscalar; // returned
+
+
+ mscalar = mxCreateDoubleMatrix(1, 1, mxREAL);
+ mxGetPr(mscalar)[0] = ((RTIfedTime&)theTime).getTime();
+
+ return mscalar;
+}
+
+
+static RTI::EventRetractionHandle*
+mvec2eventRetractHdl(const mxArray *mvec) { // supplied
+
+ RTI::EventRetractionHandle *eventRetHdl=NULL;
+
+
+ eventRetHdl = new (RTI::EventRetractionHandle);
+
+ eventRetHdl->theSerialNumber = (long unsigned int)mxGetPr(mvec)[0];
+ eventRetHdl->sendingFederate = (long unsigned int)mxGetPr(mvec)[1];
+
+ return eventRetHdl;
+
+}
+
+static void
+free_eventRetHdl(RTI::EventRetractionHandle *eventRetHdl) {
+
+ delete eventRetHdl;
+
+ return;
+
+}
+
+
+
+
+static mxArray*
+eventRetractHdl2mvec(const RTI::EventRetractionHandle theHandle) {// suppl.
+
+ mxArray *mvec; // returned
+
+
+ mvec = mxCreateDoubleMatrix(1, 2, mxREAL);
+ mxGetPr(mvec)[0] = (double) theHandle.theSerialNumber;
+ mxGetPr(mvec)[1] = (double) theHandle.sendingFederate;
+
+ return mvec;
+}
+
+
+/************************
+ * Forward Declarations *
+ * and Static Objects *
+ ************************/
+
+static RTI::RTIambassador *RTIAMB = NULL;
+class MATLABambassador;
+static MATLABambassador *FEDAMB = NULL;
+
+
+
+/***********************
+ ** **
+ ** (A) RTIambassador **
+ ** **
+ ***********************/
+
+/**********************************
+ * Federation Management Services *
+ **********************************/
+
+static void
+m2createFedExec(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ char *executionName; // supplied C4
+ char *FED; // supplied C4
+
+
+ executionName = mstr2cstr(prhs[0]);
+ FED = mstr2cstr(prhs[1]);
+
+ try {
+ RTIAMB->createFederationExecution(executionName, FED);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception& e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception, probably no
ambassadors, try rtiOn");
+ }
+
+
+ free_cstr(executionName);
+ free_cstr(FED);
+
+ return;
+}
+
+
+static void
+m2destroyFedExec(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ char *executionName; // supplied C4
+
+
+ executionName = mstr2cstr(prhs[0]);
+
+
+ try {
+ RTIAMB->destroyFederationExecution(executionName);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception& e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception, probably no
ambassadors, try rtiOn");
+ }
+
+ free_cstr(executionName);
+
+ return;
+}
+
+
+static void
+m2joinFedExec(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::FederateHandle federateHandle; // returned C3
//0 indicates error
+
+ char *yourName; // supplied C4
+ char *executionName; // supplied C4
+
+ // the following in parameter is actually not supplied but set
+ // internally to FEDAMB
+ RTI::FederateAmbassadorPtr federateAmbassadorPtr; // supplied C1
+
+
+ yourName = mstr2cstr(prhs[0]);
+ executionName = mstr2cstr(prhs[1]);
+ federateAmbassadorPtr = (RTI::FederateAmbassador*)FEDAMB;
+
+ try {
+ federateHandle =
+ RTIAMB->joinFederationExecution(yourName,
+ executionName,
+ federateAmbassadorPtr);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception, probably no
ambassadors, try rtiOn");
+ }
+
+ plhs[0] = federateHdl2mscalar(federateHandle);
+ free_cstr(yourName);
+ free_cstr(executionName);
+
+ return;
+}
+
+
+static void
+m2resignFedExec(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::ResignAction theAction; // supplied C1
+
+
+ theAction = mstr2resignAction(prhs[0]);
+
+ try {
+ RTIAMB->resignFederationExecution(theAction);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception, probably no
ambassadors, try rtiOn");
+ }
+
+ return;
+}
+
+static void
+m2registerFedSyncPoint(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ RTI::FederateHandleSet *fedHdlSet; // supplied C4
+ char *theTag; //
supplied C4
+ char *label; //
supplied C4
+
+ label = mstr2cstr
(prhs[0]);
+ theTag = mstr2cstr
(prhs[1]);
+
+
+ if (nrhs > 2) {
+ try {
+ fedHdlSet = mvec2federateHdlSet
(prhs[2]);
+
RTIAMB->registerFederationSynchronizationPoint(label,theTag,*fedHdlSet);
+ plhs[0]=cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0]=cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ free(fedHdlSet);
+ }
+ else {
+ try {
+
RTIAMB->registerFederationSynchronizationPoint(label,theTag);
+ plhs[0]=cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0]=cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ }
+
+ free_cstr(theTag);
+ free_cstr(label);
+
+}
+
+static void
+m2synchronizationPointAchieved(int nlhs, mxArray *plhs[], int nrhs, const
mxArray *prhs[]) {
+ char *label; // supplied C4
+
+ label= mstr2cstr (prhs[0]);
+
+ try {
+ RTIAMB->synchronizationPointAchieved(label);
+ plhs[0]=cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0]=cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_cstr(label);
+
+}
+
+static void
+m2requestFedSave(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+ char *label; // supplied C4
+ RTIfedTime *theTime; // supplied C4
+
+ label = mstr2cstr (prhs[0]);
+ switch (nrhs) {
+
+ case 1: try {
+
RTIAMB->requestFederationSave(label);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown
exception");
+ }
+ break;
+
+ case 2: theTime = mscalar2fedTime(prhs[1]);
+ try {
+
RTIAMB->requestFederationSave(label,*theTime);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown
exception");
+ }
+ free_fedTime(theTime);
+ break;
+ }
+ free_cstr(label);
+ return;
+}
+
+static void
+m2federateSaveBegun(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ try {
+ RTIAMB->federateSaveBegun();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ return;
+}
+
+static void
+m2federateSaveComplete(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ try {
+ RTIAMB->federateSaveComplete();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ return;
+
+}
+
+static void
+m2federateSaveNotComplete(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ try {
+ RTIAMB->federateSaveNotComplete();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ return;
+
+}
+
+static void
+m2requestFedRestore(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ char *label; // supplied C4
+
+ label= mstr2cstr (prhs[0]);
+
+ try {
+ RTIAMB->requestFederationRestore(label);
+ plhs[0]=cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0]=cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_cstr(label);
+
+}
+
+static void
+m2federateRestoreComplete(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ try {
+ RTIAMB->federateRestoreComplete();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ return;
+}
+
+static void
+m2federateRestoreNotComplete(int nlhs, mxArray *plhs[], int nrhs, const
mxArray *prhs[]) {
+ try {
+ RTIAMB->federateRestoreNotComplete();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ return;
+}
+
+
+
+
+
+/***********************************
+ * Declaration Management Services *
+ ***********************************/
+
+static void
+m2publishObjClass(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::ObjectClassHandle theClass; // supplied C1
+ RTI::AttributeHandleSet *attrList; // supplied C4
+
+
+ theClass = mscalar2objClassHdl(prhs[0]);
+ attrList = mvec2attrHdlSet (prhs[1]);
+
+
+ try {
+ RTIAMB->publishObjectClass(theClass, *attrList);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_attrHdlSet(attrList);
+
+ return;
+}
+
+static void
+m2unpublishObjClass(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+ RTI::ObjectClassHandle theClass; // supplied C1
+
+
+ theClass = mscalar2objClassHdl(prhs[0]);
+
+
+ try {
+ RTIAMB->unpublishObjectClass(theClass);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2publishInteractClass(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTI::InteractionClassHandle theInteraction; // supplied C1
+
+
+ theInteraction = mscalar2interactClassHdl(prhs[0]);
+
+ try {
+ RTIAMB->publishInteractionClass(theInteraction);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2unpublishInteractClass(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTI::InteractionClassHandle theInteraction; // supplied C1
+
+
+ theInteraction = mscalar2interactClassHdl(prhs[0]);
+
+
+ try {
+ RTIAMB->unpublishInteractionClass(theInteraction);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2subscribeObjClassAttr(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTI::ObjectClassHandle theClass; // supplied C1
+ RTI::AttributeHandleSet *attrList; // supplied C4
+ RTI::Boolean active; // supplied C1
+ // (default: active = RTI_TRUE)
+
+
+ theClass = mscalar2objClassHdl(prhs[0]);
+ attrList = mvec2attrHdlSet (prhs[1]);
+ if (nrhs > 2) {
+ active = mscalar2bool (prhs[2]);
+ }
+
+ try {
+ if (nrhs > 2) {
+ RTIAMB->subscribeObjectClassAttributes(theClass,
+ *attrList,
+ active);
+ }
+ else {
+ RTIAMB->subscribeObjectClassAttributes(theClass,
+ *attrList);
+ }
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_attrHdlSet(attrList);
+
+ return;
+}
+
+static void
+m2unsubscribeObjClass(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTI::ObjectClassHandle theClass; // supplied C1
+
+
+ theClass = mscalar2objClassHdl(prhs[0]);
+
+ try {
+ RTIAMB->unsubscribeObjectClass(theClass);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2subscribeInteractClass(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTI::InteractionClassHandle theClass; // supplied C1
+ RTI::Boolean active; // supplied C1
+ // (default: active = RTI_TRUE)
+
+
+ theClass = mscalar2interactClassHdl(prhs[0]);
+ if (nrhs > 1) {
+ active = mscalar2bool (prhs[1]);
+ }
+
+
+ try {
+ if (nrhs > 1) {
+ RTIAMB->subscribeInteractionClass(theClass,active);
+ }
+ else {
+ RTIAMB->subscribeInteractionClass(theClass);
+ }
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2unsubscribeInteractClass(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTI::InteractionClassHandle theClass; // supplied C1
+
+
+ theClass = mscalar2interactClassHdl(prhs[0]);
+
+
+ try {
+
+ RTIAMB->unsubscribeInteractionClass(theClass);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+
+/******************************
+ * Object Management Services *
+ ******************************/
+
+static void
+m2registerObjInst(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::ObjectClassHandle theClass; // supplied C1
+ char *theObject; // supplied C4
+
+ RTI::ObjectHandle objHdl; // returned C3
+ // two overloaded methods
+
+
+ theClass = mscalar2objClassHdl(prhs[0]);
+ if (nrhs > 1) {
+ theObject = mstr2cstr (prhs[1]);
+ }
+
+
+ try {
+ if (nrhs > 1) {
+ objHdl = RTIAMB->registerObjectInstance(theClass,
+ theObject);
+ }
+ else {
+ objHdl = RTIAMB->registerObjectInstance(theClass);
+ }
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+ plhs[0] = objHdl2mscalar(objHdl);
+
+ return;
+}
+
+
+static void
+m2updateAttrVal(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::ObjectHandle theObject; // supplied C1
+ RTI::AttributeHandleValuePairSet *theAttr; // supplied C4
+ RTIfedTime *theTime; // supplied C4
+ char *theTag; // supplied C4
+
+ RTI::EventRetractionHandle eventRetractHdl;// returned C3
+ // two overloaded methods
+
+
+ theObject = mscalar2objHdl (prhs[0]);
+ theAttr = mcell2attrHdlValPairSet(prhs[1]);
+ if (nrhs < 4) {
+ theTag = mstr2cstr (prhs[2]);
+ }
+ else {
+ theTime = mscalar2fedTime (prhs[2]);
+ theTag = mstr2cstr (prhs[3]);
+ }
+
+
+ if (nrhs < 4) {
+ try {
+ RTIAMB->updateAttributeValues(theObject,
+ *theAttr,
+ theTag);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+ }
+ else {
+ try {
+ eventRetractHdl = RTIAMB->updateAttributeValues(
+ theObject,
+ *theAttr,
+ *theTime,
+ theTag);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+ plhs[0] = eventRetractHdl2mvec(eventRetractHdl);
+
+ free_fedTime(theTime);
+ }
+
+ free_attrHdlValPairSet(theAttr);
+ free_cstr(theTag);
+
+ return;
+}
+
+
+static void
+m2sendInteract(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::InteractionClassHandle theInteraction; // supplied C1
+ RTI::ParameterHandleValuePairSet *theParameters; // supplied C4
+ RTIfedTime *theTime; // supplied C4
+ char *theTag; // supplied C4
+
+ RTI::EventRetractionHandle eventRetractHdl;// returned C3
+ // two overloaded methods
+
+
+ theInteraction = mscalar2interactClassHdl (prhs[0]);
+ theParameters = mcell2paramHdlValPairSet(prhs[1]);
+ if (nrhs < 4) {
+ theTag = mstr2cstr (prhs[2]);
+ }
+ else {
+ theTime = mscalar2fedTime (prhs[2]);
+ theTag = mstr2cstr (prhs[3]);
+ }
+
+
+ if (nrhs < 4) {
+ try {
+ RTIAMB->sendInteraction(theInteraction,
+ *theParameters,
+ theTag);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ }
+ else {
+ try {
+ eventRetractHdl = RTIAMB->sendInteraction(
+ theInteraction,
+ *theParameters,
+ *theTime,
+ theTag);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+ plhs[0] = eventRetractHdl2mvec(eventRetractHdl);
+
+ free_fedTime(theTime);
+ }
+
+ free_paramHdlValPairSet(theParameters);
+ free_cstr(theTag);
+
+ return;
+}
+
+
+static void
+m2deleteObjInst(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::ObjectHandle theObject; // supplied C1
+ RTIfedTime *theTime; // supplied C4
+ char *theTag; // supplied C4
+
+ RTI::EventRetractionHandle eventRetractHdl;// returned C3
+ // two overloaded methods
+
+
+ theObject = mscalar2objHdl (prhs[0]);
+ if (nrhs < 3) {
+ theTag = mstr2cstr (prhs[1]);
+ }
+ else {
+ theTime = mscalar2fedTime(prhs[1]);
+ theTag = mstr2cstr (prhs[2]);
+ }
+
+
+ if (nrhs < 3) {
+ try {
+ RTIAMB->deleteObjectInstance(theObject,theTag);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ }
+ else {
+ try {
+ eventRetractHdl = RTIAMB->deleteObjectInstance(
+ theObject,*theTime,theTag);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+ plhs[0] = eventRetractHdl2mvec(eventRetractHdl);
+
+ free_fedTime(theTime);
+ }
+
+ free_cstr(theTag);
+
+ return;
+}
+
+static void
+m2changeAttrTransType(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ RTI::ObjectHandle theObject; //
supplied C1
+ RTI::AttributeHandleSet *theAttributes; // supplied C4
+ RTI::TransportationHandle theType; // supplied C1
+
+ theObject = mscalar2objHdl
(prhs[0]);
+ theAttributes = mvec2attrHdlSet (prhs[1]);
+ theType = mscalar2TransHdl
(prhs[2]);
+
+
+ try {
+
RTIAMB->changeAttributeTransportationType(theObject,*theAttributes,theType);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_attrHdlSet(theAttributes);
+}
+
+static void
+m2changeInteractTransType(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ RTI::InteractionClassHandle theClass; // supplied C1
+ RTI::TransportationHandle theType; // supplied C1
+
+ theClass = mscalar2interactClassHdl
(prhs[0]);
+ theType = mscalar2TransHdl
(prhs[1]);
+
+
+ try {
+ RTIAMB->changeInteractionTransportationType(theClass,theType);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+}
+
+static void
+m2localDelObjInst(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+ RTI::ObjectHandle theObject; // supplied C1
+
+ theObject = mscalar2objHdl
(prhs[0]);
+
+ try {
+ RTIAMB->localDeleteObjectInstance(theObject);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+}
+
+static void
+m2requestClassAttrValUp(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ RTI::ObjectClassHandle theClass; // supplied C1
+ RTI::AttributeHandleSet *theAttributes; // supplied C4
+
+ theClass = mscalar2objClassHdl
(prhs[0]);
+ theAttributes = mvec2attrHdlSet (prhs[1]);
+
+ try {
+ RTIAMB->requestClassAttributeValueUpdate(theClass,
*theAttributes);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_attrHdlSet(theAttributes);
+}
+
+static void
+m2requestObjAttrValUp(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+ RTI::ObjectHandle theObject; // supplied C1
+ RTI::AttributeHandleSet *theAttributes; // supplied C4
+
+ theObject = mscalar2objHdl
(prhs[0]);
+ theAttributes = mvec2attrHdlSet (prhs[1]);
+
+ try {
+ RTIAMB->requestObjectAttributeValueUpdate(theObject,
*theAttributes);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_attrHdlSet(theAttributes);
+}
+
+/****************************
+ * Time Management Services *
+ ****************************/
+
+static void
+m2enableTimeReg(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *theFederateTime; // supplied C4
+ RTIfedTime *theLookahead; // supplied C4
+
+
+ theFederateTime = mscalar2fedTime(prhs[0]);
+ theLookahead = mscalar2fedTime(prhs[1]);
+
+ try {
+ RTIAMB->enableTimeRegulation(*theFederateTime,*theLookahead);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theFederateTime);
+ free_fedTime(theLookahead);
+
+ return;
+}
+
+
+static void
+m2enableTimeConstr(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
+
+ try {
+ RTIAMB->enableTimeConstrained();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ return;
+}
+
+
+static void
+m2timeAdvReq(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *theTime; // supplied C4
+
+
+ theTime = mscalar2fedTime(prhs[0]);
+
+
+ try {
+ RTIAMB->timeAdvanceRequest(*theTime);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theTime);
+
+ return;
+}
+
+
+
+static void
+m2changeAttrOrderType(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+ RTI::ObjectHandle theObject; // supplied C1
+ RTI::AttributeHandleSet *theAttributes; // supplied C4
+ RTI::OrderingHandle theType; //
supplied C1
+
+
+ theObject = mscalar2objHdl
(prhs[0]);
+ theAttributes = mvec2attrHdlSet (prhs[1]);
+ theType = mscalar2orderHdl
(prhs[2]);
+
+ try {
+ RTIAMB->changeAttributeOrderType(theObject, *theAttributes,
theType);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_attrHdlSet(theAttributes);
+}
+
+static void
+m2changeInteractOrderType(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+ RTI::InteractionClassHandle theClass; //
supplied C1
+ RTI::OrderingHandle theType;
// supplied C1
+
+
+ theClass = mscalar2interactClassHdl
(prhs[0]);
+ theType = mscalar2orderHdl
(prhs[1]);
+
+ try {
+ RTIAMB->changeInteractionOrderType(theClass, theType);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+}
+
+static void
+m2disableAsyncDeliv(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+
+ try {
+ RTIAMB->disableAsynchronousDelivery();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+}
+
+static void
+m2disableTimeConstr(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+
+ try {
+ RTIAMB->disableTimeConstrained();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+}
+
+static void
+m2disableTimeReg(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ try {
+ RTIAMB->disableTimeRegulation();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+}
+
+static void
+m2flushQueueReq(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *theTime; // supplied C4
+
+
+ theTime = mscalar2fedTime(prhs[0]);
+
+
+ try {
+ RTIAMB->flushQueueRequest(*theTime);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theTime);
+
+ return;
+}
+
+static void
+m2modifyLookahead(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *theLookahead; // supplied C4
+
+
+ theLookahead = mscalar2fedTime(prhs[0]);
+
+
+ try {
+ RTIAMB->modifyLookahead(*theLookahead);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theLookahead);
+
+ return;
+}
+
+static void
+m2nextEventReq(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *theTime; // supplied C4
+
+
+ theTime = mscalar2fedTime(prhs[0]);
+
+
+ try {
+ RTIAMB->nextEventRequest(*theTime);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theTime);
+
+ return;
+}
+
+static void
+m2nextEventReqAvail(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+ RTIfedTime *theTime; // supplied C4
+
+
+ theTime = mscalar2fedTime(prhs[0]);
+
+
+ try {
+ RTIAMB->nextEventRequestAvailable(*theTime);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theTime);
+
+ return;
+}
+
+static void
+m2queryFedTime(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime theTime; // supplied C4
+
+ try {
+ RTIAMB->queryFederateTime(theTime);
+ plhs[0] = fedTime2mscalar(theTime);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2queryLBTS(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime theTime; // supplied C4
+
+ try {
+ RTIAMB->queryLBTS(theTime);
+ plhs[0] = fedTime2mscalar(theTime);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2queryLookahead(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime theTime; // supplied C4
+
+ try {
+ RTIAMB->queryLookahead(theTime);
+ plhs[0] = fedTime2mscalar(theTime);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2queryMinNextEventTime(int nlhs, mxArray *plhs[], int nrhs, const mxArray
*prhs[]) {
+
+ RTIfedTime theTime; // supplied C4
+
+
+ try {
+ RTIAMB->queryMinNextEventTime(theTime);
+ plhs[0] = fedTime2mscalar(theTime);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ return;
+}
+
+static void
+m2retract(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::EventRetractionHandle *theHandle; // supplied C1
+
+ theHandle = mvec2eventRetractHdl(prhs[0]);
+
+ try {
+ RTIAMB->retract(*theHandle);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+ free_eventRetHdl(theHandle);
+
+ return;
+}
+
+
+static void
+m2timeAdvReqAvail(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *theTime; // supplied C4
+
+
+ theTime = mscalar2fedTime(prhs[0]);
+
+
+ try {
+ RTIAMB->timeAdvanceRequestAvailable(*theTime);
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ free_fedTime(theTime);
+
+ return;
+}
+
+
+/**********************
+ * Ancillary Services *
+ **********************/
+
+static void
+m2getObjClassHdl(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ char *theName; // supplied C4
+
+ RTI::ObjectClassHandle objClassHdl; // returned C3
+
+
+ theName = mstr2cstr(prhs[0]);
+
+ try {
+ objClassHdl = RTIAMB->getObjectClassHandle(theName);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = objClassHdl2mscalar(objClassHdl);
+
+ free_cstr(theName);
+
+ return;
+}
+
+
+static void
+m2getAttrHdl(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ char *theName; // supplied C4
+ RTI::ObjectClassHandle whichClass; // supplied C1
+
+ RTI::AttributeHandle attrHdl; // returned C3
+
+
+ theName = mstr2cstr (prhs[0]);
+ whichClass = mscalar2objClassHdl(prhs[1]);
+
+ try {
+ attrHdl = RTIAMB->getAttributeHandle(theName, whichClass);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = attrHdl2mscalar(attrHdl);
+
+ free_cstr(theName);
+
+ return;
+}
+
+
+
+static void
+m2getInteractClassHdl(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ char *theName; // supplied C4
+
+ RTI::InteractionClassHandle interactClassHdl; // returned C3
+
+
+ theName = mstr2cstr(prhs[0]);
+
+
+ try {
+ interactClassHdl = RTIAMB->getInteractionClassHandle(theName);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = interactClassHdl2mscalar(interactClassHdl);
+
+ free_cstr(theName);
+
+ return;
+}
+
+
+static void
+m2getParamHdl(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ char *theName; // supplied C4
+ RTI::InteractionClassHandle whichClass; // supplied C1
+
+ RTI::ParameterHandle paramHdl; // returned C3
+
+
+ theName = mstr2cstr (prhs[0]);
+ whichClass = mscalar2interactClassHdl(prhs[1]);
+
+
+ try {
+ paramHdl = RTIAMB->getParameterHandle(theName, whichClass);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = paramHdl2mscalar(paramHdl);
+
+ free_cstr(theName);
+
+ return;
+}
+
+static void
+m2getTransHdl(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+ char *theName; // supplied C4
+ RTI::TransportationHandle transHdl; // returned
+
+ theName = mstr2cstr (prhs[0]);
+
+ try {
+ transHdl = RTIAMB->getTransportationHandle(theName);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = transHdl2mscalar(transHdl);
+
+ free_cstr(theName);
+
+ return;
+}
+
+static void
+m2getOrderingHdl(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+ char *theName; // supplied C4
+ RTI::OrderingHandle orderHdl; // returned
+
+ theName = mstr2cstr (prhs[0]);
+
+ try {
+ orderHdl = RTIAMB->getOrderingHandle(theName);
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = orderHdl2mscalar(orderHdl);
+
+ free_cstr(theName);
+
+ return;
+}
+
+static void
+m2enableAsyncDeliv(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
+
+ try {
+ RTIAMB->enableAsynchronousDelivery();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ return;
+}
+
+
+static void
+m2enableAttrRelAdvisSwitch(int nlhs, mxArray *plhs[],int nrhs, const mxArray
*prhs[]) {
+
+ try {
+ RTIAMB->enableAttributeRelevanceAdvisorySwitch();
+ plhs[0] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[0] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[0]=cstr2mstr("caught unknown exception");
+ }
+
+
+ return;
+}
+
+
+static void
+m2tick(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ RTI::TickTime minimum; // supplied C1
+ RTI::TickTime maximum; // supplied C1
+
+ RTI::Boolean boolVal; // returned C3
+ // two overloaded methods
+
+
+ if (nrhs > 0) {
+ minimum = mscalar2tickTime(prhs[0]);
+ maximum = mscalar2tickTime(prhs[1]);
+ }
+
+
+ try {
+ if (nrhs > 0) {
+ boolVal = RTIAMB->tick(minimum, maximum);
+ }
+ else {
+ boolVal = RTIAMB->tick();
+ }
+ plhs[1] = cstr2mstr("");
+ }
+ catch (RTI::Exception &e) {
+ plhs[1] = cstr2mstr(e._name);
+ }
+ catch (...) {
+ plhs[1]=cstr2mstr("caught unknown exception");
+ }
+
+
+ plhs[0] = bool2mscalar(boolVal);
+
+ return;
+}
+
+
+
+
+
+
+
+/****************************
+ ** **
+ ** (B) FederateAmbassador **
+ ** **
+ ****************************/
+
+/* Class MATLABAmbassador - The General Matlab Federate Ambassador *
+ * A derived class of the abstract FederateAmbassador class. */
+
+class MATLABambassador : public RTI::FederateAmbassador
+{
+public:
+
+
+MATLABambassador()
+{
+};
+
+
+virtual ~MATLABambassador()
+throw(RTI::FederateInternalError)
+{
+};
+
+
+////////////////////////////////////
+// Federation Management Services //
+////////////////////////////////////
+
+
+virtual void synchronizationPointRegistrationSucceeded (
+ const char *label) // supplied C4)
+throw (
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = cstr2mstr(label);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "syncPointRegSuccess");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+
+virtual void synchronizationPointRegistrationFailed (
+ const char *label) // supplied C4)
+throw (
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = cstr2mstr(label);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "syncPointRegFailed");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+virtual void announceSynchronizationPoint (
+ const char *label, // supplied C4
+ const char *tag) // supplied C4
+throw (
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = cstr2mstr(label);
+ prhs[1] = cstr2mstr(tag);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "announceSyncPoint");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+
+virtual void federationSynchronized (
+ const char *label) // supplied C4)
+throw (
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = cstr2mstr(label);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "fedSync");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void initiateFederateSave (
+ const char *label) // supplied C4
+throw (
+ RTI::UnableToPerformSave,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = cstr2mstr(label);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "initiateFedSave");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+virtual void federationSaved ()
+throw (
+ RTI::FederateInternalError)
+{
+ mexCallMATLAB(0, NULL, 0, NULL, "fedSaved");
+
+ return;
+};
+
+
+virtual void federationNotSaved ()
+throw (
+ RTI::FederateInternalError)
+{
+ mexCallMATLAB(0, NULL, 0, NULL, "fedNotSaved");
+
+ return;
+};
+
+
+virtual void requestFederationRestoreSucceeded (
+ const char *label) // supplied C4
+throw (
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = cstr2mstr(label);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "requestFedResSuccess");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void requestFederationRestoreFailed (
+ const char *label,
+ const char *reason) // supplied C4
+throw (
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = cstr2mstr(label);
+ prhs[1] = cstr2mstr(reason);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "requestFedResFailed");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+virtual void federationRestoreBegun ()
+throw (
+ RTI::FederateInternalError)
+{
+ mexCallMATLAB(0, NULL, 0, NULL, "fedResBegun");
+
+ return;
+};
+
+
+virtual void initiateFederateRestore (
+ const char *label, // supplied C4
+ RTI::FederateHandle handle) // supplied C1
+throw (
+ RTI::SpecifiedSaveLabelDoesNotExist,
+ RTI::CouldNotRestore,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = cstr2mstr(label);
+ prhs[1] = federateHdl2mscalar(handle);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "initiateFedRestore");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+virtual void federationRestored ()
+throw (
+ RTI::FederateInternalError)
+{
+ mexCallMATLAB(0, NULL, 0, NULL, "fedRestored");
+
+ return;
+};
+
+
+virtual void federationNotRestored ()
+throw (
+ RTI::FederateInternalError)
+{
+ mexCallMATLAB(0, NULL, 0, NULL, "fedNotRestored");
+
+ return;
+};
+
+
+/////////////////////////////////////
+// Declaration Management Services //
+/////////////////////////////////////
+
+virtual void startRegistrationForObjectClass (
+ RTI::ObjectClassHandle theClass) // supplied C1
+throw (
+ RTI::ObjectClassNotPublished,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = objClassHdl2mscalar(theClass);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "startRegForObjClass");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void stopRegistrationForObjectClass (
+ RTI::ObjectClassHandle theClass) // supplied C1
+throw (
+ RTI::ObjectClassNotPublished,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = objClassHdl2mscalar(theClass);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "stopRegForObjClass");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void turnInteractionsOn (
+ RTI::InteractionClassHandle theHandle) // supplied C1
+throw (
+ RTI::InteractionClassNotPublished,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = interactClassHdl2mscalar(theHandle);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "turnInteractOn");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void turnInteractionsOff (
+ RTI::InteractionClassHandle theHandle) // supplied C1
+throw (
+ RTI::InteractionClassNotPublished,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = interactClassHdl2mscalar(theHandle);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "turnInteractOff");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+////////////////////////////////
+// Object Management Services //
+////////////////////////////////
+
+virtual void discoverObjectInstance (
+ RTI::ObjectHandle theObject, // supplied C1
+ RTI::ObjectClassHandle theObjectClass, // supplied C1
+ const char *theObjectName) // supplied C4
+throw (
+ RTI::CouldNotDiscover,
+ RTI::ObjectClassNotKnown,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[3];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = objClassHdl2mscalar(theObjectClass);
+ prhs[2] = cstr2mstr (theObjectName);
+
+ mexCallMATLAB(0, NULL, 3, prhs, "discoverObjInst");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+
+ return;
+};
+
+
+virtual void reflectAttributeValues (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleValuePairSet &theAttributes, // supplied C4
+ const RTI::FedTime &theTime, // supplied C1
+ const char *theTag, // supplied C4
+ RTI::EventRetractionHandle theHandle) // supplied C1
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateOwnsAttributes,
+ RTI::InvalidFederationTime,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[5];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlValPairSet2mcell (theAttributes);
+ prhs[2] = fedTime2mscalar(theTime);
+ prhs[3] = cstr2mstr (theTag);
+ prhs[4] = eventRetractHdl2mvec (theHandle);
+
+ mexCallMATLAB(0, NULL, 5, prhs, "reflectAttrVal");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+ mxDestroyArray(prhs[3]);
+ mxDestroyArray(prhs[4]);
+
+ return;
+};
+
+
+virtual void reflectAttributeValues (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleValuePairSet &theAttributes, // supplied C4
+ const char *theTag) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateOwnsAttributes,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[3];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlValPairSet2mcell (theAttributes);
+ prhs[2] = cstr2mstr (theTag);
+
+ mexCallMATLAB(0, NULL, 3, prhs, "reflectAttrVal");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+
+ return;
+};
+
+
+virtual void receiveInteraction (
+ RTI::InteractionClassHandle theInteraction, // supplied C1
+ const RTI::ParameterHandleValuePairSet &theParameters, // supplied C4
+ const RTI::FedTime &theTime, // supplied C4
+ const char *theTag, // supplied C4
+ RTI::EventRetractionHandle theHandle) // supplied C1
+throw (
+ RTI::InteractionClassNotKnown,
+ RTI::InteractionParameterNotKnown,
+ RTI::InvalidFederationTime,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[5];
+
+ prhs[0] = interactClassHdl2mscalar(theInteraction);
+ prhs[1] = paramHdlValPairSet2mcell (theParameters);
+ prhs[2] = fedTime2mscalar(theTime);
+ prhs[3] = cstr2mstr (theTag);
+ prhs[4] = eventRetractHdl2mvec (theHandle);
+
+ mexCallMATLAB(0, NULL, 5, prhs, "receiveInteract");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+ mxDestroyArray(prhs[3]);
+ mxDestroyArray(prhs[4]);
+
+ return;
+};
+
+
+virtual void receiveInteraction (
+ RTI::InteractionClassHandle theInteraction, // supplied C1
+ const RTI::ParameterHandleValuePairSet &theParameters, // supplied C4
+ const char *theTag) // supplied C4
+throw (
+ RTI::InteractionClassNotKnown,
+ RTI::InteractionParameterNotKnown,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[3];
+
+ prhs[0] = interactClassHdl2mscalar(theInteraction);
+ prhs[1] = paramHdlValPairSet2mcell (theParameters);
+ prhs[2] = cstr2mstr (theTag);
+
+ mexCallMATLAB(0, NULL, 3, prhs, "receiveInteract");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+
+ return;
+};
+
+
+virtual void removeObjectInstance (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::FedTime &theTime, // supplied C4
+ const char *theTag, // supplied C4
+ RTI::EventRetractionHandle theHandle) // supplied C1
+throw (
+ RTI::ObjectNotKnown,
+ RTI::InvalidFederationTime,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[4];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = fedTime2mscalar(theTime);
+ prhs[2] = cstr2mstr (theTag);
+ prhs[3] = eventRetractHdl2mvec (theHandle);
+
+ mexCallMATLAB(0, NULL, 4, prhs, "removeObjInst");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+ mxDestroyArray(prhs[3]);
+
+ return;
+};
+
+
+virtual void removeObjectInstance (
+ RTI::ObjectHandle theObject, // supplied C1
+ const char *theTag) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = cstr2mstr (theTag);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "removeObjInst");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+virtual void attributesInScope (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlSet2mvec (theAttributes);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "attrInScope");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+virtual void attributesOutOfScope (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlSet2mvec (theAttributes);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "attrOutOfScope");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+virtual void provideAttributeValueUpdate (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeNotOwned,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlSet2mvec (theAttributes);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "provideAttrValUpdate");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+virtual void turnUpdatesOnForObjectInstance (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotOwned,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlSet2mvec (theAttributes);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "turnUpdatesOnForObjInst");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+virtual void turnUpdatesOffForObjectInstance (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotOwned,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[2];
+
+ prhs[0] = objHdl2mscalar(theObject);
+ prhs[1] = attrHdlSet2mvec (theAttributes);
+
+ mexCallMATLAB(0, NULL, 2, prhs, "turnUpdatesOffForObjInst");
+
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+
+ return;
+};
+
+
+///////////////////////////////////
+// Ownership Management Services //
+///////////////////////////////////
+
+virtual void requestAttributeOwnershipAssumption (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &offeredAttributes, // supplied C4
+ const char *theTag) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeAlreadyOwned,
+ RTI::AttributeNotPublished,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::requestAttributeOwnershipAssumption()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::requestAttributeOwnershipAssumption()\n");
+};
+
+
+virtual void attributeOwnershipDivestitureNotification (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &releasedAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeNotOwned,
+ RTI::AttributeDivestitureWasNotRequested,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::attributeOwnershipDivestitureNotification()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::attributeOwnershipDivestitureNotification()\n");
+};
+
+
+virtual void attributeOwnershipAcquisitionNotification (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &securedAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeAcquisitionWasNotRequested,
+ RTI::AttributeAlreadyOwned,
+ RTI::AttributeNotPublished,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::attributeOwnershipAcquisitionNotification()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::attributeOwnershipAcquisitionNotification()\n");
+};
+
+
+virtual void attributeOwnershipUnavailable (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeAlreadyOwned,
+ RTI::AttributeAcquisitionWasNotRequested,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::attributeOwnershipUnavailable()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::attributeOwnershipUnavailable()\n");
+};
+
+
+virtual void requestAttributeOwnershipRelease (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &candidateAttributes, // supplied C4
+ const char *theTag) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeNotOwned,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::requestAttributeOwnershipRelease()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::requestAttributeOwnershipRelease()\n");
+};
+
+
+virtual void confirmAttributeOwnershipAcquisitionCancellation (
+ RTI::ObjectHandle theObject, // supplied C1
+ const RTI::AttributeHandleSet &theAttributes) // supplied C4
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::AttributeAlreadyOwned,
+ RTI::AttributeAcquisitionWasNotCanceled,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::confirmAttributeOwnershipAcquisitionCancellation()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::confirmAttributeOwnershipAcquisitionCancellation()\n");
+};
+
+
+virtual void informAttributeOwnership (
+ RTI::ObjectHandle theObject, // supplied C1
+ RTI::AttributeHandle theAttribute, // supplied C1
+ RTI::FederateHandle theOwner) // supplied C1
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::informAttributeOwnership()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::informAttributeOwnership()\n");
+};
+
+
+virtual void attributeIsNotOwned (
+ RTI::ObjectHandle theObject, // supplied C1
+ RTI::AttributeHandle theAttribute) // supplied C1
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::attributeIsNotOwned()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::attributeIsNotOwned()\n");
+};
+
+
+virtual void attributeOwnedByRTI (
+ RTI::ObjectHandle theObject, // supplied C1
+ RTI::AttributeHandle theAttribute) // supplied C1
+throw (
+ RTI::ObjectNotKnown,
+ RTI::AttributeNotKnown,
+ RTI::FederateInternalError)
+{
+printf(">>>MATLABambassador::attributeOwnedByRTI()\n");
+ cerr << "not supported" << endl;
+printf("<<<MATLABambassador::attributeOwnedByRTI()\n");
+};
+
+
+//////////////////////////////
+// Time Management Services //
+//////////////////////////////
+
+virtual void timeRegulationEnabled (
+ const RTI::FedTime &theFederateTime) // supplied C4
+throw (
+ RTI::InvalidFederationTime,
+ RTI::EnableTimeRegulationWasNotPending,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = fedTime2mscalar(theFederateTime);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "timeRegEnabled");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+void timeConstrainedEnabled (
+ const RTI::FedTime &theFederateTime) // supplied C4
+throw (
+ RTI::InvalidFederationTime,
+ RTI::EnableTimeConstrainedWasNotPending,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = fedTime2mscalar(theFederateTime);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "timeConstrEnabled");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void timeAdvanceGrant (
+ const RTI::FedTime &theTime) // supplied C4
+throw (
+ RTI::InvalidFederationTime,
+ RTI::TimeAdvanceWasNotInProgress,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = fedTime2mscalar(theTime);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "timeAdvGrant");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+virtual void requestRetraction (
+ RTI::EventRetractionHandle theHandle) // supplied C1
+throw (
+ RTI::EventNotKnown,
+ RTI::FederateInternalError)
+{
+ mxArray *prhs[1];
+
+ prhs[0] = eventRetractHdl2mvec(theHandle);
+
+ mexCallMATLAB(0, NULL, 1, prhs, "requestRetract");
+
+ mxDestroyArray(prhs[0]);
+
+ return;
+};
+
+
+}; /* End of class MATLABambassador definition */
+
+
+
+/**************************************
+ ** **
+ ** (C) Classes and Supporting Types **
+ ** **
+ **************************************/
+
+/***********
+ * FedTime *
+ ***********/
+
+static void
+getEpsilon(int nlhs, mxArray *plhs[],
+ int nrhs, const mxArray *prhs[]) {
+
+ RTIfedTime *timeObjPtr;
+
+
+ timeObjPtr = new RTIfedTime();
+
+ if (!timeObjPtr) {
+ mexErrMsgTxt("rti.mex:getEpsilon(): new RTIfedTime() failed.");
+ }
+
+ timeObjPtr->setEpsilon();
+
+ plhs[0] = fedTime2mscalar(*timeObjPtr);
+
+ delete timeObjPtr;
+
+ return;
+}
+
+
+/*********************************************
+ * Interface Initialization/Deinitialization *
+ *********************************************/
+
+static void
+rtiAtExitFailed() {
+ mexWarnMsgTxt("rtiAtExit(): MEX file rti is cleared from Matlab\
+ in an unexpected way.");
+ return;
+}
+
+static void
+rtiAtExitSuccess() {
+ printf("Deinitialization successfull\n");
+ return;
+}
+
+static void
+newRtiAmb() {
+
+ if (RTIAMB) {
+ mexWarnMsgTxt("RTI ambassador already created.");
+ return;
+ }
+ RTIAMB = new RTI::RTIambassador;
+ if (!RTIAMB) {
+ mexErrMsgTxt("Can't create RTI ambassador, new failed.");
+ return;
+ }
+
+ return;
+}
+
+
+static void
+newFedAmb() {
+
+ if (FEDAMB) {
+ mexWarnMsgTxt("FED ambassador already created.");
+ return;
+ }
+
+ FEDAMB = new MATLABambassador;
+ if (!FEDAMB) {
+ mexErrMsgTxt("Can't create FED ambassador, new failed.");
+ return;
+ }
+
+ return;
+}
+
+
+static void
+rtiOn() {
+ if (!mexIsLocked()) {
+ mexAtExit(rtiAtExitFailed);
+ mexLock();
+ newRtiAmb();
+ newFedAmb();
+ }
+ else {
+ mexWarnMsgTxt("Matlab/RTI/Matlab interface already init.");
+ }
+ return;
+}
+
+
+static void
+deleteRtiAmb() {
+
+ if (!RTIAMB) {
+ mexWarnMsgTxt("RTI amabassador already deleted.");
+ return;
+ }
+ delete RTIAMB;
+
+ return;
+}
+
+
+static void
+deleteFedAmb() {
+
+ if (!FEDAMB) {
+ mexWarnMsgTxt("FED amabassador already deleted.");
+ return;
+ }
+ delete FEDAMB;
+
+ return;
+}
+
+
+static void
+rtiOff() {
+ if (mexIsLocked()) {
+ deleteRtiAmb();
+ deleteFedAmb();
+ mexAtExit(rtiAtExitSuccess);
+ mexUnlock();
+ }
+ else {
+ mexWarnMsgTxt("Matlab/RTI/Matlab interface already deinit.");
+ }
+ return;
+}
+
+
+extern void _main(); /* from a MathWorks C++ example; don't know *
+ * the meaning */
+
+/*******************
+ * Gateway Routine *
+ *******************/
+
+void
+mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+
+ int opcode; /* operation code */
+
+ /* read operation code and drop it from input arg list */
+ opcode = (int) mxGetScalar(prhs[0]);
+ prhs++;
+ nrhs--;
+
+
+ /* call wrapper routine */
+ switch (opcode) {
+
+
+ /* Interface Initialization/Deinitialization */
+ case 1: rtiOn (); break;
+ case 2: rtiOff (); break;
+
+ /* Data Conversions */
+ case 50: double2net (nlhs,plhs,nrhs,prhs); break;
+ case 51: net2double (nlhs,plhs,nrhs,prhs); break;
+ case 52: char2net (nlhs,plhs,nrhs,prhs); break;
+ case 53: net2char (nlhs,plhs,nrhs,prhs); break;
+
+ /*********************
+ * (A) RTIambassador *
+ *********************/
+
+ /* Federation Management Services */
+ case 4020: m2createFedExec
(nlhs,plhs,nrhs,prhs); break;
+ case 4030: m2destroyFedExec
(nlhs,plhs,nrhs,prhs); break;
+ case 4040: m2joinFedExec
(nlhs,plhs,nrhs,prhs); break;
+ case 4050: m2resignFedExec
(nlhs,plhs,nrhs,prhs); break;
+ case 4060: m2registerFedSyncPoint
(nlhs,plhs,nrhs,prhs); break;
+ case 4070: m2synchronizationPointAchieved (nlhs,plhs,nrhs,prhs);
break;
+ case 4080: m2requestFedSave
(nlhs,plhs,nrhs,prhs); break;
+ case 4090: m2federateSaveBegun
(nlhs,plhs,nrhs,prhs); break;
+ case 4100: m2federateSaveComplete
(nlhs,plhs,nrhs,prhs); break;
+ case 4110: m2federateSaveNotComplete (nlhs,plhs,nrhs,prhs);
break;
+ case 4120: m2requestFedRestore
(nlhs,plhs,nrhs,prhs); break;
+ case 4130: m2federateRestoreComplete
(nlhs,plhs,nrhs,prhs); break;
+ case 4140: m2federateRestoreNotComplete (nlhs,plhs,nrhs,prhs);
break;
+
+
+ /* Declaration Management Services */
+ case 5020: m2publishObjClass
(nlhs,plhs,nrhs,prhs); break;
+ case 5040: m2publishInteractClass
(nlhs,plhs,nrhs,prhs); break;
+ case 5060: m2subscribeObjClassAttr
(nlhs,plhs,nrhs,prhs); break;
+ case 5080: m2subscribeInteractClass (nlhs,plhs,nrhs,prhs);
break;
+ case 5100: m2unpublishInteractClass
(nlhs,plhs,nrhs,prhs); break;
+ case 5120: m2unpublishObjClass
(nlhs,plhs,nrhs,prhs); break;
+ case 5140: m2unsubscribeInteractClass
(nlhs,plhs,nrhs,prhs); break;
+ case 5160: m2unsubscribeObjClass
(nlhs,plhs,nrhs,prhs); break;
+
+ /* Object Management Services */
+ case 6020: m2registerObjInst
(nlhs,plhs,nrhs,prhs); break;
+ case 6040: m2updateAttrVal
(nlhs,plhs,nrhs,prhs); break;
+ case 6060: m2sendInteract
(nlhs,plhs,nrhs,prhs); break;
+ case 6080: m2deleteObjInst
(nlhs,plhs,nrhs,prhs); break;
+ case 6100: m2changeAttrTransType
(nlhs,plhs,nrhs,prhs); break;
+ case 6120: m2changeInteractTransType
(nlhs,plhs,nrhs,prhs); break;
+ case 6140: m2localDelObjInst
(nlhs,plhs,nrhs,prhs); break;
+ case 6160: m2requestClassAttrValUp
(nlhs,plhs,nrhs,prhs); break;
+ case 6180: m2requestObjAttrValUp
(nlhs,plhs,nrhs,prhs); break;
+
+ /* Time Management Services */
+ case 8020: m2enableTimeReg
(nlhs,plhs,nrhs,prhs); break;
+ case 8050: m2enableTimeConstr
(nlhs,plhs,nrhs,prhs); break;
+ case 8080: m2timeAdvReq
(nlhs,plhs,nrhs,prhs); break;
+ case 8140: m2enableAsyncDeliv
(nlhs,plhs,nrhs,prhs); break;
+ case 8200: m2queryLookahead
(nlhs,plhs,nrhs,prhs); break;
+ case 8300: m2changeAttrOrderType
(nlhs,plhs,nrhs,prhs); break;
+ case 8320: m2changeInteractOrderType
(nlhs,plhs,nrhs,prhs); break;
+ case 8340: m2disableAsyncDeliv
(nlhs,plhs,nrhs,prhs); break;
+ case 8360: m2disableTimeConstr
(nlhs,plhs,nrhs,prhs); break;
+ case 8380: m2disableTimeReg
(nlhs,plhs,nrhs,prhs); break;
+ case 8400: m2flushQueueReq
(nlhs,plhs,nrhs,prhs); break;
+ case 8420: m2modifyLookahead
(nlhs,plhs,nrhs,prhs); break;
+ case 8440: m2nextEventReq
(nlhs,plhs,nrhs,prhs); break;
+ case 8460: m2nextEventReqAvail
(nlhs,plhs,nrhs,prhs); break;
+ case 8480: m2queryFedTime
(nlhs,plhs,nrhs,prhs); break;
+ case 8500: m2queryLBTS
(nlhs,plhs,nrhs,prhs); break;
+ case 8520: m2queryMinNextEventTime
(nlhs,plhs,nrhs,prhs); break;
+ case 8540: m2retract
(nlhs,plhs,nrhs,prhs); break;
+ case 8560: m2timeAdvReqAvail
(nlhs,plhs,nrhs,prhs); break;
+
+ /* Ancillary Services */
+ case 10020: m2getObjClassHdl
(nlhs,plhs,nrhs,prhs); break;
+ case 10040: m2getAttrHdl
(nlhs,plhs,nrhs,prhs); break;
+ case 10060: m2getInteractClassHdl
(nlhs,plhs,nrhs,prhs); break;
+ case 10080: m2getParamHdl
(nlhs,plhs,nrhs,prhs); break;
+ case 10100: m2getTransHdl
(nlhs,plhs,nrhs,prhs); break;
+ case 10120: m2getOrderingHdl
(nlhs,plhs,nrhs,prhs); break;
+ case 10250: m2enableAttrRelAdvisSwitch (nlhs,plhs,nrhs,prhs);
break;
+ case 10310: m2tick
(nlhs,plhs,nrhs,prhs); break;
+
+
+ /************************************
+ * (C) Classes and Supporting Types *
+ ************************************/
+
+ /* FedTime */
+ case 100110: getEpsilon (nlhs,plhs,nrhs,prhs); break;
+
+
+ default: mexErrMsgTxt("Function not implemented on this "
+ "platform or unknown operation code.\n");
+ };
+
+ return;
+}
+
Index: demo/TwoLevelController/TwoLevelController.fed
===================================================================
RCS file: demo/TwoLevelController/TwoLevelController.fed
diff -N demo/TwoLevelController/TwoLevelController.fed
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ demo/TwoLevelController/TwoLevelController.fed 28 Jan 2008 21:46:26
-0000 1.1
@@ -0,0 +1,25 @@
+;; TwoLevelController
+
+(Fed
+ (Federation TwoLevelController)
+ (FedVersion v1.3)
+ (Federate "controlFed" "Public")
+ (Federate "processFed" "Public")
+ (Spaces
+ )
+ (Objects
+ (Class ObjectRoot
+ (Attribute privilegeToDelete reliable timestamp)
+ (Class RTIprivate)
+ (Class TwoLevelControllerClass
+ (Attribute U RELIABLE TIMESTAMP)
+ (Attribute Y RELIABLE TIMESTAMP)
+ )
+ )
+ )
+ (Interactions
+ (Class InteractionRoot BEST_EFFORT RECEIVE
+ (Class RTIprivate BEST_EFFORT RECEIVE)
+ )
+ )
+)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- applications/MatlabHLA_Toolbox m_files/changeIn...,
certi-cvs <=