资源简介
本文开发并且实现了一个基于地理信息系统的简单的交通仿真系统。论文的第一章对现有的交通仿真系统进行了简单的综述和论述,对部分软件的特点进行了分析。为交通系统的功能设计和体系设计提供基础。论文的第二章首先对元胞自动机和智能体的理论的进行了探讨和论述,为建立基于元胞自动机和智能体的交通仿真模型打下理论基础。第三章对地理信息系统功能进行了分析,并且对现有的地理信息系统平台的特点进行了介绍和分析,选择了合适的地理信息系统平台,目的在于利用地理信息系统的功能,为交通仿真系统服务。第四章是论文的核心,主要提出仿真系统的功能设计,体系结构设计,以及对仿真系统影响重大的交通仿真模型,包括交通基础设施模型、...
代码片段和文件信息
using System;
using System.Drawing;
namespace SubSys_MathUtility
{
public class MyPoint
{
public float _X;
public float _Y;
public MyPoint(float x float y)
{
this._X = x;
this._Y = y;
}
public PointF ToPointF()
{
return new PointF(this._X this._Y);
}
}
///
/// 内部路段的相对坐标系统转化绝对元胞坐标系系统
///
public static class Coordinates
{
///
/// 元胞坐标系和图像坐标系统之间的偏移量,
/// 初始两个坐标系统的原点都在图像坐标系原点处向右平移X为正
/// 向下平移Y为正
///
public static Point GUI_Offset = new Point(0 0);
/////
///// 将元胞坐标系转换为屏幕坐标系,内部使用了GUIsettig中的GUI_CellPixels;
/////
/////
/////
public static Point Project(Point rltPos int iCellPixels)
{
return Coordinates.Project(new MyPoint(rltPos.X rltPos.Y) iCellPixels);
}
public static Point Project(MyPoint mp int iScaleFactor)
{
Point scrnPoint = new Point();
scrnPoint.X = (int)Math.Round(iScaleFactor * mp._X);
scrnPoint.Y = (int)Math.Round(iScaleFactor * mp._Y);
//计算平移(偏移)
scrnPoint.X -= Coordinates.GUI_Offset.X;
scrnPoint.Y -= Coordinates.GUI_Offset.Y;
return scrnPoint;//这个是个结构参数复制,然后返回新的结果
}
///
/// offset中x和y的值左上都为负值
///
/// 原坐标系
/// 偏移坐标
///
public static Point Offset(Point scrnPoint Point offset)
{
//计算平移(偏移)
scrnPoint.X -= offset.X;
scrnPoint.Y -= offset.Y;
return scrnPoint;//这个是个结构参数复制,然后返回新的结果
}
public static MyPoint Offset(MyPoint scrnPoint MyPoint offset)
{
MyPoint mp = new MyPoint(scrnPoint._X scrnPoint._Y);
//计算平移(偏移)
mp._X -= offset._X;
mp._Y -= offset._Y;
return mp;
}
public static MyPoint Offset(Point scrnPoint MyPoint offset)
{
MyPoint mp = new MyPoint(scrnPoint.X - offset._X scrnPoint.Y - offset._Y);
//计算平移(偏移)
//scrnPoint.X -= offset.X;
//scrnPoint.Y -= offset.Y;
return mp;//这个是个结构参数复制,然后返回新的结果
}
///
/// 输入新坐标系的点,返回旧坐标系的点
///
///
///
///
public static Point Rotate(Point mpNewSinCos a)
{
Point mp=new Point(00);
mp.X = mpNew.X * a.iCos - mpNew.Y * a.iSin;
mp.Y = mpNew.X * a.iSin +
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.....H. 18 2012-01-08 21:14 TranMACASims\.cvsignore
.....H. 12292 2013-07-30 13:00 TranMACASims\.DS_Store
....... 825 2012-03-26 16:06 TranMACASims\CVS\Entries
....... 692 2012-03-26 16:06 TranMACASims\CVS\Entries.Extra
....... 657 2012-03-26 16:05 TranMACASims\CVS\Entries.Extra.Old
....... 793 2012-03-26 16:05 TranMACASims\CVS\Entries.Old
....... 14 2011-12-15 15:14 TranMACASims\CVS\Repository
....... 23 2011-12-15 15:14 TranMACASims\CVS\Root
....... 28 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\CVS\Entries
....... 34 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\CVS\Entries.Extra
....... 16 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\CVS\Entries.Extra.Old
....... 13 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\CVS\Entries.Old
....... 34 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\CVS\Repository
....... 23 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\CVS\Root
....... 0 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Debug\CVS\Entries
....... 0 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Debug\CVS\Entries.Extra
....... 40 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Debug\CVS\Repository
....... 23 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Debug\CVS\Root
....... 0 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Release\CVS\Entries
....... 0 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Release\CVS\Entries.Extra
....... 42 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Release\CVS\Repository
....... 23 2012-03-13 08:48 TranMACASims\GisTranSimModel\bin\Release\CVS\Root
....... 104 2012-03-13 08:49 TranMACASims\GisTranSimModel\CVS\Entries
....... 99 2012-03-13 08:49 TranMACASims\GisTranSimModel\CVS\Entries.Extra
....... 89 2012-03-13 08:48 TranMACASims\GisTranSimModel\CVS\Entries.Extra.Old
....... 111 2012-03-13 08:48 TranMACASims\GisTranSimModel\CVS\Entries.Old
....... 30 2012-03-13 08:48 TranMACASims\GisTranSimModel\CVS\Repository
....... 23 2012-03-13 08:48 TranMACASims\GisTranSimModel\CVS\Root
....... 1248 2012-02-24 14:06 TranMACASims\GisTranSimModel\GisTranSimModel.modelproj
....... 53 2012-03-13 08:49 TranMACASims\GisTranSimModel\ModelDefinition\CVS\Entries
............此处省略1284个文件信息
评论
共有 条评论