org.cloudsimplus.core.SimulationNull Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudsim-plus Show documentation
Show all versions of cloudsim-plus Show documentation
CloudSim Plus: A modern, highly extensible and easier-to-use Java 8+ Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services
The newest version!
package org.cloudsimplus.core;
import org.cloudsimplus.core.events.SimEvent;
import org.cloudsimplus.listeners.EventInfo;
import org.cloudsimplus.listeners.EventListener;
import org.cloudsimplus.network.topologies.NetworkTopology;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.function.Predicate;
/**
* A class that implements the Null Object Design Pattern for {@link Simulation}
* class.
*
* @author Manoel Campos da Silva Filho
* @see Simulation#NULL
*/
final class SimulationNull implements Simulation {
@Override public boolean isThereAnyFutureEvt(Predicate predicate) { return false; }
@Override public boolean isTerminationTimeSet() { return false; }
@Override public void abort() {/**/}
@Override public void addEntity(CloudSimEntity entity) {/**/}
@Override public SimEvent cancel(SimEntity src, Predicate predicate) {
return SimEvent.NULL;
}
@Override public boolean cancelAll(SimEntity src, Predicate predicate) {
return false;
}
@Override public double clock() { return 0.0; }
@Override public String clockStr() { return ""; }
@Override public double clockInMinutes() { return 0.0; }
@Override public double clockInHours() { return 0.0; }
@Override public SimEvent findFirstDeferred(SimEntity dest, Predicate predicate) { return SimEvent.NULL; }
@Override public Calendar getCalendar() {
return Calendar.getInstance();
}
@Override public CloudInformationService getCis() {
return null;
}
@Override public List getEntityList() { return Collections.emptyList(); }
@Override public double getMinTimeBetweenEvents() {
return 0;
}
@Override public int getNumEntities() {
return 0;
}
@Override public boolean removeOnEventProcessingListener(EventListener listener) {
return false;
}
@Override public Simulation addOnSimulationPauseListener(EventListener listener) {
return this;
}
@Override public Simulation addOnSimulationStartListener(EventListener listener) { return this; }
@Override public boolean removeOnSimulationPauseListener(EventListener listener) {
return false;
}
@Override public boolean isPaused() {
return false;
}
@Override public void pauseEntity(SimEntity src, double delay) {/**/}
@Override public boolean pause() {
return false;
}
@Override public boolean pause(double time) {
return false;
}
@Override public boolean resume() {
return false;
}
@Override public boolean isRunning() {
return false;
}
@Override public SimEvent select(SimEntity dest, Predicate predicate) { return SimEvent.NULL; }
@Override public void send(SimEvent evt) {/**/}
@Override public void send(SimEntity src, SimEntity dest, double delay, CloudSimTag tag, Object data) {/**/}
@Override public void sendFirst(SimEvent evt) {/**/}
@Override public void sendFirst(SimEntity src, SimEntity dest, double delay, CloudSimTag tag, Object data) {/**/}
@Override public void sendNow(SimEntity src, SimEntity dest, CloudSimTag tag, Object data) {/**/}
@Override public double runFor(double interval) { return 0; }
@Override public Simulation addOnEventProcessingListener(EventListener listener) {
return this;
}
@Override public Simulation addOnClockTickListener(EventListener listener) {
return this;
}
@Override public boolean removeOnClockTickListener(EventListener extends EventInfo> listener) {
return false;
}
@Override public double start() throws RuntimeException { return 0; }
@Override public void startSync() { /**/ }
@Override public boolean isTimeToTerminateSimulationUnderRequest() { return false; }
@Override public boolean terminate() {
return false;
}
@Override public boolean terminateAt(double time) {
return false;
}
@Override public void wait(CloudSimEntity src, Predicate predicate) {/**/}
@Override public NetworkTopology getNetworkTopology() { return NetworkTopology.NULL; }
@Override public Simulation setNetworkTopology(NetworkTopology networkTopology) { return this; }
@Override public long getNumberOfFutureEvents(Predicate predicate) { return 0; }
@Override public double getLastCloudletProcessingUpdate() { return 0; }
@Override public Simulation setLastCloudletProcessingUpdate(double lastCloudletProcessingUpdate) { return this; }
@Override public boolean isAbortRequested() {return true;}
@Override public boolean isAborted() {return true; }
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy