bap/utrecht_custom.py
def allocation_coverage(self, allocation):
        """Get the sufficient coverage vector associated with an allocation."""
        sufficient = self.get_sufficient_coverage()
        adj = self.get_binary_adjacency()
        n = len(self.V)
        coverages = [0 for _ in range(n)]
        for i in range(len(allocation)):
            base = self.B[i]
            num_amb = allocation[i]
            coverages = [coverages[j]+num_amb*adj[base, j] for j in range(n)]
        # Normalize ambulance coverage to sufficient coverage
        coverages = [1 if coverages[i] >= sufficient[i] else 0 for i in range(n)]
        return coverages
Get the sufficient coverage vector associated with an allocation.
Get the sufficient coverage vector associated with an allocation.
Get the sufficient coverage vector associated with an allocation .
def allocation_coverage(self, allocation):
        sufficient = self.get_sufficient_coverage()
        adj = self.get_binary_adjacency()
        n = len(self.V)
        coverages = [0 for _ in range(n)]
        for i in range(len(allocation)):
            base = self.B[i]
            num_amb = allocation[i]
            coverages = [coverages[j]+num_amb*adj[base, j] for j in range(n)]
        coverages = [1 if coverages[i] >= sufficient[i] else 0 for i in range(n)]
        return coverages
def allocation_coverage ( self , allocation ) : sufficient = self . get_sufficient_coverage ( ) adj = self . get_binary_adjacency ( ) n = len ( self . V ) coverages = [ 0 for _ in range ( n ) ] for i in range ( len ( allocation ) ) : base = self . B [ i ] num_amb = allocation [ i ] coverages = [ coverages [ j ] + num_amb * adj [ base , j ] for j in range ( n ) ] coverages = [ 1 if coverages [ i ] >= sufficient [ i ] else 0 for i in range ( n ) ] return coverages
Get the sufficient coverage vector associated with an allocation.
Get the sufficient coverage vector associated with an allocation .
"""Get the sufficient coverage vector associated with an allocation.""" # Normalize ambulance coverage to sufficient coverage
self
allocation