Package haizea :: Package core :: Package scheduler :: Module slottable :: Class OngoingAvailability
[hide private]
[frames] | no frames]

Class OngoingAvailability

source code


Information about ongoing availability in a node

An OngoingAvailability object contains information not just about the availability starting at a given time, but also how that availability diminishes over time. Thus, it the object to use when determining if, starting at a given time, it is possible to fit some capacity up to a certain time (with or without preempting other leases).

Typically, you will want to create an OngoingAvailability object using the get_ongoing_availability method in AvailabilityWindow

Instance Methods [hide private]
 
__init__(self, node, preempted_leases)
Constructor
source code
bool
fits(self, capacity, until)
Determine if there is enough capacity until a given time.
source code
DateTime
latest_fit(self, capacity)
Determine for how long we can fit a given capacity.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, node, preempted_leases)
(Constructor)

source code 

Constructor

Parameters:
Overrides: object.__init__

fits(self, capacity, until)

source code 

Determine if there is enough capacity until a given time.

Parameters:
Returns: bool
True if the given capacity can fit until the given time. False otherwise.

latest_fit(self, capacity)

source code 

Determine for how long we can fit a given capacity.

Parameters:
Returns: DateTime
The latest time at which the given capacity fits in the node.