RIAPS / riaps-dsml

RIAPS Modeling Language for Eclipse plugin
Apache License 2.0
1 stars 1 forks source link

Request/Reply Linkage Missing in Actor Declaration #20

Closed MMetelko closed 6 years ago

MMetelko commented 6 years ago

The following statement is not understood in the actor declaration:

filter.query = sensor.request;

Here is the rule from the riaps_pycom - riaps.tx:

// Wiring of clients to servers (both SMI and AMI)
Wire:
  lhsName=ID '.' lhsPortName=ID '=' rhsName=ID '.' rhsPortName=ID ';'
;

Here is an example .riaps file

// RIAPS Sample

app DistributedEstimator {
    // Message types used in the app
    message SensorReady; 
    message SensorQuery; 
    message SensorValue; 
    message Estimate;

    // Sensor component
    component Sensor {
      timer clock 1000;                             // Periodic timer trigger to trigger sensor every 1 sec
      pub ready : SensorReady ;                     // Publish port for SensorReady messages 
      rep request : ( SensorQuery , SensorValue ) ; // Reply port to query the sensor and retrieve its value
    }

    // Local estimator component
    component LocalEstimator (iArg,fArg,sArg,bArg) {
      sub ready : SensorReady ;                     // Subscriber port to trigger component with SensorReady messages
      req query : (SensorQuery , SensorValue ) ;    // Request port to query the sensor and retrieve its value
      pub estimate : Estimate ;                     // Publish port to publish estimated value messages
    }

    // Global estimator
    component GlobalEstimator (iArg=123,fArg=4.56,sArg="string",bArg=true) {
      sub estimate : Estimate ;                     // Subscriber port to receive the local estimates
      timer wakeup 3000;                            // Periodic timer to wake up estimator every 3 sec
    }

    // Estimator actor
    actor Estimator {
       local SensorReady, SensorQuery, SensorValue ;    // Local message types
       {  // Sensor component
          sensor : Sensor;                              
          // Local estimator, publishes global message 'Estimate' 
          filter : LocalEstimator(iArg=789,fArg=0.12,sArg="text",bArg=false);
       }
       filter.query = sensor.request;                   // Sensor and local estimator are connected
    }
    actor Aggregator (posArg,optArg="optString") {
       {  // Global estimator, subscribes to 'Estimate' messages
          aggr : GlobalEstimator(iArg=posArg,sArg=optArg,bArg=true);    
       }
    }
}
MMetelko commented 6 years ago

Related to https://github.com/RIAPS/riaps-pycom/issues/79

MMetelko commented 6 years ago

Completed