我尝试模拟文档中给出的 AbstractAcousticChannel 示例(https://www.unetstack.net/channels.html#extending-the-abstractacousticchannel)我遇到了以下错误,
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: MyAcousticModel(MyAcousticChannel)
渠道
import org.arl.unet.sim.channels.*
import org.arl.unet.sim.channels.UrickAcousticModel
class MyAcousticChannel extends AbstractAcousticChannel{
@Delegate UrickAcousticModel acoustics = new MyAcousticModel(this)
@Delegate BPSKFadingModel comms = new BPSKFadingModel(this)
}
模型
import org.arl.unet.sim.channels.UrickAcousticModel
class MyAcousticModel extends UrickAcousticModel {
private final def noiseLevel = [ 0: 20, 1: 30, 2: 35, 3: 40, 4: 42, 5: 44, 6: 46 ]
float seaState = 2
double getNoisePower() {
return Math.pow(10, noiseLevel[seaState]/10) * model.bandwidth
}
}
并在模拟中
channel = [ model: MyAcousticChannel ]