IRange1D range1D = range1d.get(rangeIndex);
List<ITrajectory> listTrajectory = range1D.getTrajectoriesList();
int trajectorySize = listTrajectory.size();
// System.out.println("Trajectory Size=" + trajectorySize);
for (int trajectoryIndex = 0; trajectoryIndex < trajectorySize; trajectoryIndex++) {
IActuator actuator = listActuator.get(trajectoryIndex);
if (actuator != null && actuator.isEnabled()) {
ITrajectory trajectory = copyToTrajectoryImpl(actuator,
listTrajectory.get(trajectoryIndex));
if (trajectory != null) {
trajectories.add(trajectory);
}
}
}
}
break;
case SCAN_2D:
IConfig2D config2d = (IConfig2D) config;
IDimension2DX dimension2DX = config2d.getDimensionX();
List<IActuator> listActuator2DX = dimension2DX.getActuatorsList();
List<IRange2DX> range2DX = dimension2DX.getRangesList();
for (int i = 0; i < range2DX.size(); i++) {
List<ITrajectory> listTrajectory = range2DX.get(i)
.getTrajectoriesList();
for (int j = 0; j < listTrajectory.size(); j++) {
IActuator actuator = listActuator2DX.get(j);
if (actuator != null && actuator.isEnabled()) {
ITrajectory trajectory = copyToTrajectoryImpl(actuator,
listTrajectory.get(j));
if (trajectory != null) {
trajectories.add(trajectory);
}
}
}
}
IDimension2DY dimension2DY = config2d.getDimensionY();
List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();
List<IRange2DY> range2DY = dimension2DY.getRangesList();
for (int i = 0; i < range2DY.size(); i++) {
List<ITrajectory> listTrajectory = range2DY.get(i)
.getTrajectoriesList();
for (int j = 0; j < listTrajectory.size(); j++) {
IActuator actuator = listActuator2DY.get(j);
if (actuator != null && actuator.isEnabled()) {
ITrajectory trajectory = copyToTrajectoryImpl(actuator,
listTrajectory.get(j));
if (trajectory != null) {
trajectories.add(trajectory);
}
}
}
}
break;
case SCAN_HCS:
IConfigHCS configHCS = (IConfigHCS) config;
IDimensionHCS dimensionHCS = configHCS.getDimensionX();
List<IActuator> listActuatorHCS = dimensionHCS.getActuatorsList();
List<IRangeHCS> rangeHCS = dimensionHCS.getRangesXList();
for (int i = 0; i < rangeHCS.size(); i++) {
List<ITrajectory> listTrajectory = rangeHCS.get(i)
.getTrajectoriesList();
for (int j = 0; j < listTrajectory.size(); j++) {
IActuator actuator = listActuatorHCS.get(j);
if (actuator != null && actuator.isEnabled()) {
ITrajectory trajectory = copyToTrajectoryImpl(actuator,
listTrajectory.get(j));
if (trajectory != null) {
trajectories.add(trajectory);
}
}
}
}
break;
case SCAN_K:
IConfigK configK = (IConfigK) config;
IDimensionK dimensionK = configK.getDimensionX();
ITrajectoryK trajectoryK = dimensionK.getRangeX().getTrajectory();
List<IActuator> listTrajectory = dimensionK.getActuatorsList();
for (int i = 0; i < listTrajectory.size(); i++) {
IActuator actuatork = listTrajectory.get(i);
if (actuatork != null && actuatork.isEnabled()) {
ITrajectory trajectory = copyToTrajectoryImpl(actuatork,
trajectoryK);
if (trajectory != null) {
trajectories.add(trajectory);
}
}
}
break;
case SCAN_ENERGY:
IConfigEnergy configEnergy = (IConfigEnergy) config;
IDimensionEnergy dimensionEnergy = configEnergy.getDimensionX();
List<IActuator> listActuatorEnergy = dimensionEnergy.getActuatorsList();
List<IRangeEnergy> rangeEnergy = dimensionEnergy.getRangesEnergyList();
for (int i = 0; i < rangeEnergy.size(); i++) {
List<ITrajectory> listTrajectories = rangeEnergy.get(i)
.getTrajectoriesList();
for (int j = 0; j < listTrajectories.size(); j++) {
IActuator actuator = listActuatorEnergy.get(j);
if (actuator != null && actuator.isEnabled()) {
ITrajectory trajectory = copyToTrajectoryImpl(actuator,
listTrajectories.get(j));
if (trajectory != null) {
trajectories.add(trajectory);
}