Is there a way to write the code shorter and more compact?
quick overview of the code part: ‘State’ represents the state of the agent/car at time T and Type indicates the type of road the cell is. I check with Type and Type’ whether the roads are connected, i.e., whether there is a path from one cell to the next.