edu.kit.ifv.mobitopp.simulation.emobility.LimitedChargingDataForZone Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mobitopp Show documentation
Show all versions of mobitopp Show documentation
mobiTopp (http://mobitopp.ifv.kit.edu/) is an agent-based travel demand model developed at the Institute for transport studies at the Karlsruhe Institute of Technology (http://www.ifv.kit.edu/english/index.php). Publications about mobiTopp can be found on the project site (http://mobitopp.ifv.kit.edu/28.php).
The newest version!
package edu.kit.ifv.mobitopp.simulation.emobility;
import static edu.kit.ifv.mobitopp.util.collections.StreamUtils.warn;
import java.util.List;
import edu.kit.ifv.mobitopp.dataimport.DefaultPower;
import edu.kit.ifv.mobitopp.simulation.Location;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class LimitedChargingDataForZone extends BaseChargingDataForZone {
private static final long serialVersionUID = 1L;
public LimitedChargingDataForZone(
List chargingFacilities, DefaultPower defaultPower) {
super(chargingFacilities, defaultPower);
}
public LimitedChargingDataForZone(
List chargingFacilities, double privateChargingProbabilty,
DefaultPower defaultPower) {
super(chargingFacilities, privateChargingProbabilty, defaultPower);
}
@Override
public int numberOfAvailableChargingPoints(List chargingFacilities) {
int cnt = 0;
for (ChargingFacility facility : chargingFacilities) {
if (facility.isFree()) {
cnt++;
}
}
return cnt;
}
@Override
protected ChargingFacility freshChargingPoint(Location location, DefaultPower defaultPower) {
throw warn(new IllegalArgumentException("no free charging point found"), log);
}
}