-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcell_methods.py
36 lines (34 loc) · 997 Bytes
/
cell_methods.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# from pd_main import *
# from grid_cells import *
# from policies import *
# ------------------- CELL FUNCTIONS ------------------- #
# pickup_cells = [] # list of pickup cells
# dropoff_cells = [] # list of drop off cells
#
# # decrement blocks on cell #
# def decrementNumBlocksInCell(pos):
# cell = getCellFromPosition(pos, pickup_cells)
# cell.num_of_blocks -= 1
#
#
# # increment blocks on cell #
# def incrementNumBlocksInCell(pos):
# cell = getCellFromPosition(pos, dropoff_cells)
# cell.num_of_blocks += 1
#
# # Initialize environment to original #
# def initalizeCells(pickup_states, dropoff_states):
# pickup_cells.clear()
# dropoff_cells.clear()
#
# for pos in pickup_states:
# pickup_cells.append(Cells(pos, 5))
#
# for pos in dropoff_states:
# dropoff_cells.append(Cells(pos, 0))
#
# # returns the cell object in the given position #
# def getCellFromPosition(pos, cell_list):
# for cell in cell_list:
# if cell.position == pos:
# return cell