ConfigKModel configKModel = (ConfigKModel) config;
configKModel.removeListener(listenerConfigK);
for (ISensor sensor : config.getSensorsList()) {
((SensorModel) sensor).removeListener(listenerSensor);
}
DimensionKModel dimensionKModel = (DimensionKModel) configKModel
.getDimensionX();
dimensionKModel.removeListener(listenerDimensionK);
for (IActuator actuator : dimensionKModel.getActuatorsList()) {
((ActuatorModel) actuator).removeListener(listenerActuator);
}
IRangeK rangeK = dimensionKModel.getRangeX();
((RangeKModel) rangeK).removeListener(listenerRangeK);
ITrajectoryK trajectoryK = dimensionKModel.getTrajectory();
((TrajectoryKModel) trajectoryK).removeListener(listenerTrajectoryK);
break;
default:
throw new RuntimeException("Type not supported");