Created
February 11, 2020 15:55
-
-
Save ikatsov/8e91c6235b7874741421530b2bd59618 to your computer and use it in GitHub Desktop.
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
| class State(object): | |
| def __init__(self, warehouse_num, T, demand_history, t = 0): | |
| self.warehouse_num = warehouse_num | |
| self.factory_stock = 0 | |
| self.warehouse_stock = np.repeat(0, warehouse_num) | |
| self.demand_history = demand_history | |
| self.T = T # Length of one episode | |
| self.t = t | |
| def to_array(self): | |
| return np.concatenate( ([self.factory_stock], | |
| self.warehouse_stock, | |
| np.hstack(self.demand_history), | |
| [self.t]) ) | |
| def stock_levels(self): | |
| return np.concatenate( ([self.factory_stock], self.warehouse_stock) ) | |
| class Action(object): | |
| def __init__(self, warehouse_num): | |
| self.production_level = 0 | |
| self.shippings_to_warehouses = np.zeros(warehouse_num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment