rinde.sim.pdptw.generator.HomogenousVehicleGenerator Maven / Gradle / Ivy
The newest version!
/**
*
*/
package rinde.sim.pdptw.generator;
import static java.util.Collections.nCopies;
import org.apache.commons.math3.random.RandomGenerator;
import rinde.sim.pdptw.common.AddVehicleEvent;
import rinde.sim.pdptw.common.VehicleDTO;
import com.google.common.collect.ImmutableList;
/**
* @author Rinde van Lon
*
*/
public class HomogenousVehicleGenerator implements VehicleGenerator {
private final VehicleDTO vehicleDto;
private final int n;
public HomogenousVehicleGenerator(int numberOfVehicles, VehicleDTO dto) {
vehicleDto = dto;
n = numberOfVehicles;
}
public ImmutableList generate(RandomGenerator rng) {
return ImmutableList
.copyOf(nCopies(n, new AddVehicleEvent(-1, vehicleDto)));
}
}