changed deprecated method ramdon_integer for randint

Forward port of #1425
This commit is contained in:
Marcelo
2019-07-16 20:51:40 -03:00
committed by Corentin Le Molgat
parent 089e4ebfa1
commit 5cdde8db2c

View File

@@ -127,7 +127,7 @@ class Customers():
# The customers demand min_tw to max_tw hour time window for each
# delivery
time_windows = np.random.random_integers(min_tw * 3600, max_tw * 3600,
time_windows = np.random.randint(min_tw * 3600, max_tw * 3600,
num_stops)
# The last time a delivery window can start
latest_time = self.time_horizon - time_windows
@@ -135,7 +135,7 @@ class Customers():
stop_times = [None for o in time_windows]
# Make random timedeltas, nominally from the start of the day.
for idx in range(self.number):
stime = int(np.random.random_integers(0, latest_time[idx]))
stime = int(np.random.randint(0, latest_time[idx]))
start_times[idx] = timedelta(seconds=stime)
stop_times[idx] = (
start_times[idx] + timedelta(seconds=int(time_windows[idx])))