资源简介

可以根据车流量来控制交通信号灯(红绿灯)的时间,可以在一定程度上提高交通效率。

资源截图

代码片段和文件信息

package com.iway.trafficsimulator.bridge;


public class Matrix
{
private PointState[][] pts;
public final int MatrixRows = 101;
public final int MatrixCols = 101;

public void init()
{
for (int i = 0; i < MatrixRows; i++)
for (int j = 0; j < MatrixCols; j++)
pts[i][j] = PointState.Blank;
setRow(0 100 47 PointState.RoadBorder);
setRow(0 100 53 PointState.RoadBorder);
setCol(0 100 47 PointState.RoadBorder);
setCol(0 100 53 PointState.RoadBorder);

clearRec(47 47 7 7);
}

public Matrix()
{
pts = new PointState[MatrixRows][MatrixCols];
init();
}

public void setRow(int start int end int row PointState ps)
{
for (int i = start; i <= end; i++)
pts[row][i] = ps;
}

public void setCol(int start int en

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-01 16:02  TrafficSimulator\
     目录           0  2014-04-01 16:02  TrafficSimulator\com\
     目录           0  2014-04-01 16:02  TrafficSimulator\com\iway\
     目录           0  2014-04-01 16:02  TrafficSimulator\com\iway\trafficsimulator\
     目录           0  2014-04-01 16:02  TrafficSimulator\com\iway\trafficsimulator\bridge\
     文件        1470  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\bridge\Matrix.java
     文件         143  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\bridge\PointState.java
     文件         315  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\bridge\Program.java
     目录           0  2014-04-01 16:02  TrafficSimulator\com\iway\trafficsimulator\express\
     文件        1385  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\express\DrawGraphics.java
     文件         486  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\express\Monitor.java
     目录           0  2014-04-01 16:02  TrafficSimulator\com\iway\trafficsimulator\logic\
     文件        1185  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\logic\Car.java
     文件        1945  2014-04-01 14:43  TrafficSimulator\com\iway\trafficsimulator\logic\ConditionViewer.java
     文件        5112  2014-04-01 14:42  TrafficSimulator\com\iway\trafficsimulator\logic\Controller.java
     文件        2951  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\logic\CreatCars.java
     文件        5609  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\logic\MoveCars.java
     文件        2116  2013-07-04 20:11  TrafficSimulator\com\iway\trafficsimulator\logic\TrafficLightControl.java

评论

共有 条评论