1

I tried simulating the AbstractAcousticChannel example given in the documentation(https://www.unetstack.net/channels.html#extending-the-abstractacousticchannel) I have encountered the following error,

groovy.lang.GroovyRuntimeException: Could not find matching constructor for: MyAcousticModel(MyAcousticChannel)

channel

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)
 }

model

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
}
}

and in simulation

channel = [ model: MyAcousticChannel ]

1 Answers1

1

The MyAcousticModel needs the correct constructor. You can add this to your clas s definition, something like:

import org.arl.unet.sim.channels.AbstractAcousticChannel

class MyAcousticModel extends UrickAcousticModel {

  MyAcousticModel(AbstractAcousticChannel parent) {
    super(parent)
  }

    :
    :

}
Mandar Chitre
  • 2,110
  • 6
  • 14