Syntax 我可以使用if语句来比较.ned文件-omnet++;?
谁能帮我学一下语法吗?我标出了错误的部分 我需要在omnet的.ned文件中找到if语句的正确语法++Syntax 我可以使用if语句来比较.ned文件-omnet++;?,syntax,omnet++,Syntax,Omnet++,谁能帮我学一下语法吗?我标出了错误的部分 我需要在omnet的.ned文件中找到if语句的正确语法++ simple Source { parameters: @group(Queueing); @signal[created](type="long"); @statistic[created](title="the number of jobs created"; record=last; interpolationmode=none);
simple Source
{
parameters:
@group(Queueing);
@signal[created](type="long");
@statistic[created](title="the number of jobs created"; record=last; interpolationmode=none);
string jobName = default("job");
double startTime @unit(s) = default(interArrivalTime); // when the module sends out the first job
double stopTime @unit(s) = default(-1s); // when the module stops the job generation (-1 means no limit)
if (jobName =="SimpleEvent"){ //syntax here is wrong!
volatile int eventType = default(intuniform(1,3));
}
gates:
inout out; //modified
}
在NED中,只能对连接和子模块使用
if
条件。必须无条件地声明参数。因此,在您的代码中应该如下所示:
double startTime @unit(s) = default(interArrivalTime); // when the module sends out the first job
double stopTime @unit(s) = default(-1s); // when the module stops the job generation (-1 means no limit)
volatile int eventType = default(intuniform(1,3));
用于连接和子模块!