Class AbstractLoadBalancer
- java.lang.Object
-
- edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.loaddistribution.balancers.AbstractLoadBalancer
-
- All Implemented Interfaces:
ILoadBalancer
- Direct Known Subclasses:
IdleToThresholdBalancer
,OneToIdleBalancer
,ToThresholdBalancer
public abstract class AbstractLoadBalancer extends Object implements ILoadBalancer
-
-
Field Summary
Fields Modifier and Type Field Description protected double
balancing_interval
Minimum time that needs to pass between two load balancing attemptsprotected Hashtable<IResourceInstance,Double>
last_balanced
protected boolean
prio_increasing
Determines the order how movable processes are returned.protected boolean
queue_ascending
Determines the order how movable processes are returned.protected MultipleQueuesStrategy
queue_holder
Holder of the runqueues that need to be balanced.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLoadBalancer(double balancing_interval, boolean prio_increasing, boolean queue_ascending)
Creates a new instance of a load balancer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
load(IResourceInstance instance)
void
setQueueHolder(MultipleQueuesStrategy queue_holder)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.loaddistribution.ILoadBalancer
activelyBalance, onFork, onSleep, onTerminate, onWake
-
-
-
-
Field Detail
-
balancing_interval
protected double balancing_interval
Minimum time that needs to pass between two load balancing attempts
-
queue_holder
protected MultipleQueuesStrategy queue_holder
Holder of the runqueues that need to be balanced.
-
prio_increasing
protected boolean prio_increasing
Determines the order how movable processes are returned. If true, the priority of the processes is increasing, otherwise decreasing.
-
queue_ascending
protected boolean queue_ascending
Determines the order how movable processes are returned. If true, the first processes are returned in the same order of the queue, otherwise they are returned in reverse order.
-
last_balanced
protected Hashtable<IResourceInstance,Double> last_balanced
-
-
Constructor Detail
-
AbstractLoadBalancer
protected AbstractLoadBalancer(double balancing_interval, boolean prio_increasing, boolean queue_ascending)
Creates a new instance of a load balancer.- Parameters:
balancing_interval
- Minimum time that needs to pass between two executions of the load balancer.prio_increasing
- Determines the order how movable processes are returned. If true, the priority of the processes is increasing, otherwise decreasing.queue_ascending
- Determines the order how movable processes are returned. If true, the first processes are returned in the same order of the queue, otherwise they are returned in reverse order.
-
-
Method Detail
-
load
protected int load(IResourceInstance instance)
-
setQueueHolder
public void setQueueHolder(MultipleQueuesStrategy queue_holder)
-
-