[Haizea] How to normalize into a score about high_capacity_score?
柯俊峰
kjf620520 at gmail.com
Wed Oct 21 22:45:45 CDT 2009
class GreedyPolicy(HostSelectionPolicy):
"""A greedy host selection policy.
This policy scores hosts such that hosts with fewer leases already
scheduled on them, with the highest capacity, and with fewest leases
scheduled in the future are scored highest.
"""
def __init__(self, slottable):
"""Constructor
Argument
slottable -- A fully constructed SlotTable
"""
HostSelectionPolicy.__init__(self, slottable)
def get_host_score(self, node, time, lease):
"""Computes the score of a host
See class documentation for details on what policy is implemented
here.
See documentation of HostSelectionPolicy.get_host_score for more
details
on this method.
Arguments:
node -- Physical node (the integer identifier used in the slot
table)
time -- Time at which the lease might be scheduled
lease -- Lease that is being scheduled.
"""
aw = self.slottable.get_availability_window(time)
* # 2nd: we prefer nodes with the highest capacity
avail = aw.get_availability_at(node, time)
# TODO: normalize into a score
high_capacity_score = 1.0*
How to normalize into a score about high_capacity_score?
Can you give me a idea ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.uchicago.edu/pipermail/haizea/attachments/20091022/c16167ca/attachment.htm
More information about the Haizea
mailing list