有人可以帮我解决这个问题吗?我标记了错误的部分 我需要在omnet ++
的.ned文件中找到if语句的正确语法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
}
答案 0 :(得分:1)
在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));