2

I have a channel model, where some transmission loss is calculated, If I have to test it against different values of frequency and print the values calculated in getRxPower(rx) function in simulation script, how can I access this value in the simulation script.

  • Why not simply print the value in the channel model class? – Mandar Chitre Jun 01 '19 at 17:54
  • Yes, I can do that for my channel model. But I also want to print the values from UrickAcousticModel ( [ https://www.unetstack.net/javadoc/org/arl/unet/sim/channels/UrickAcousticModel.html] ). @Mandar Chitre – DEEKSHITH N S Jun 02 '19 at 11:17

1 Answers1

2

The simplest way may be to create your own channel model that extends the UrickAcousticModel, override the getRxPower() method, and log the return value of the original method before returning it.

This might look something like:

public class MyUrickAcousticModel extends org.arl.unet.sim.channels.UrickAcousticModel {

  protected Logger log = Logger.getLogger(getClass().getName());

  @Override
  public double getRxPower(org.arl.unet.sim.Reception rx) {
    double v = super.getRxPower(rx);
    log.info("getRxPower returned "+v);
    return v;
  }

}

You can then use this model in your simulation, exactly in the same way as the UrickAcousticModel.

Mandar Chitre
  • 2,110
  • 6
  • 14