'Use the \'ram_free\' for a particular instance_type advertised from a
child cell\'s capacity to compute a weight.  We want to direct the
build to a cell with a higher capacity.  Since higher weights win,
we just return the number of units available for the instance_type.'

def _weigh_object(self, cell, weight_properties):

    request_spec = weight_properties['request_spec']
    instance_type = request_spec['instance_type']
    memory_needed = instance_type['memory_mb']
    ram_free = cell.capacities.get('ram_free', {})
    units_by_mb = ram_free.get('units_by_mb', {})
    return units_by_mb.get(str(memory_needed), 0)
