/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim.KOM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* PeerfactSim.KOM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see .
*
*/
package de.tud.kom.p2psim.impl.energy;
import java.util.LinkedList;
import de.tud.kom.p2psim.impl.topology.component.UAVTopologyComponent;
import de.tudarmstadt.maki.simonstrator.api.Host;
import de.tudarmstadt.maki.simonstrator.api.component.HostComponent;
import de.tudarmstadt.maki.simonstrator.api.component.HostComponentFactory;
/**
* Ground-based charger for UAVs
*
*
* @author Julian Zobel
* @version 1.0, 21.09.2018
*/
public class UAVCharger implements HostComponent {
private Host host;
private long replacementDuration;
private int chargerSize;
private LinkedList uavs = new LinkedList<>();
public UAVCharger(Host host, long replacementDuration, int chargerSize) {
this.host = host;
this.replacementDuration = replacementDuration;
this.chargerSize = chargerSize;
}
@Override
public void initialize() {
// TODO Auto-generated method stub
}
@Override
public void shutdown() {
throw new UnsupportedOperationException("Charger shutdown not supported!");
}
@Override
public Host getHost() {
return host;
}
public static class Factory implements HostComponentFactory {
private long replacementDuration;
private int chargerSize;
public void setReplacementDuration(long replacementDuration) {
this.replacementDuration = replacementDuration;
}
public void setChargerSize(int chargerSize) {
this.chargerSize = chargerSize;
}
@Override
public HostComponent createComponent(Host host) {
return new UAVCharger(host, replacementDuration, chargerSize);
}
}
}