Simulation in intersection
pgn = intersection(data,wsim)
This function is used to simulate number of vehicle in every lanes of intersection. This function has two inputs, that is a matrix that contains information needed to run the simulation and a scalar that represents simulation time. The input matrix is denoted by data and has exactly 9 column. Every column contains same information. This is the information stored in every column of that matrix.
The output of this function is also a matrix. The number of rows equal with number of lanes in intersection. Number of columns of this matrix represents the simulation time. The element of this matrix is nonnegative integer that represents number of vehicle at every lanes in every time.