This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class ReplayBuffer: | |
def __init__(self, a = 1.0, b = 0.7): | |
self.keys = [] | |
self.values = [] | |
self.a = a | |
# b < 1.0 allows to sample near the max key more frequently. | |
# This allows to sample more trajectories where optimization is difficult, 1.0 will do uniform distribution. | |
self.b = b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/cyang-kth/maximum-coverage-location | |
import numpy as np | |
from gurobipy import * | |
from numpy import random | |
from scipy.spatial import distance_matrix | |
import argparse | |
def mclp(points, sites, demands, B, radius): | |
print('----- Configurations -----') |