ConfigEnergyModel configEnergyModel = (ConfigEnergyModel) config;
configEnergyModel.removeListener(listenerConfigEnergy);
for (ISensor sensor : config.getSensorsList()) {
((SensorModel) sensor).removeListener(listenerSensor);
}
DimensionEnergyModel dimensionEnergyModel = (DimensionEnergyModel) configEnergyModel
.getDimensionX();
dimensionEnergyModel.removeListener(listenerDimensionEnergy);
for (IActuator actuator : dimensionEnergyModel.getActuatorsList()) {
((ActuatorModel) actuator).removeListener(listenerActuator);
}
for (IRangeEnergy rangeEnergy : dimensionEnergyModel.getRangesEnergyList()) {
((RangeEnergyModel) rangeEnergy).removeListener(listenerRangeEnergy);
}
for (ITrajectoryEnergy trajectoryEnergy : dimensionEnergyModel
.getTrajectoriesEnergyList()) {
((TrajectoryEnergyModel) trajectoryEnergy)
.removeListener(listenerTrajectoryEnergy);
}
break;