IDimensionEnergy dimensionEnergy = ((IConfigEnergy) config).getDimensionX();
List<IActuator> actuatorsList = dimensionEnergy.getActuatorsList();
if (actuatorsList.size() != 0) {
IActuator actuator = actuatorsList.get(0);
IRangeEnergy rangeEnergy = createRange();
rangeEnergy.setDimension(dimensionEnergy);
ITrajectoryEnergy trajectoryEnergy = createTrajectory();
trajectoryEnergy.setRange(rangeEnergy);
trajectoryEnergy.setActuator(actuator);
List<ITrajectoryEnergy> trajectoriesEnergyList = dimensionEnergy.getTrajectoriesEnergyList();
if (trajectoriesEnergyList == null) {
trajectoriesEnergyList = new ArrayList<ITrajectoryEnergy>();
dimensionEnergy.setTrajectoriesEnergyList(trajectoriesEnergyList);
}
trajectoriesEnergyList.add(trajectoryEnergy);
List<ITrajectory> trajectoryList = rangeEnergy.getTrajectoriesList();
if (trajectoryList == null) {
trajectoryList = new ArrayList<ITrajectory>();
rangeEnergy.setTrajectoriesList(trajectoryList);
}
trajectoryList.add(trajectoryEnergy);
dimensionEnergy.getRangesEnergyList().add(rangeEnergy);
((IConfigEnergy) config).setDimensionX(dimensionEnergy);
dimension = dimensionEnergy;