决策支持系统作业最终.docx

上传人:b****6 文档编号:6557884 上传时间:2023-01-07 格式:DOCX 页数:14 大小:68.56KB
下载 相关 举报
决策支持系统作业最终.docx_第1页
第1页 / 共14页
决策支持系统作业最终.docx_第2页
第2页 / 共14页
决策支持系统作业最终.docx_第3页
第3页 / 共14页
决策支持系统作业最终.docx_第4页
第4页 / 共14页
决策支持系统作业最终.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

决策支持系统作业最终.docx

《决策支持系统作业最终.docx》由会员分享,可在线阅读,更多相关《决策支持系统作业最终.docx(14页珍藏版)》请在冰豆网上搜索。

决策支持系统作业最终.docx

决策支持系统作业最终

决策支持系统导论

期末作业

姓名:

齐鹏

学号:

日期:

2012年7月9日

1、设某企业生产多种最终产品Y=(yij),各种产品的单价为Pi,它们的投入产出直接消耗系数为A=(aij),企业的资源(煤、电力、劳力)的约束方程为BX<=>h(“<=>”表示<、=、>),其中,B=(bij)是资源消耗系数矩阵,X=(xi)是企业总产品向量,h是资源约束向量。

为使企业净产值最大,其目标方程S=∑Piyi→max,试安排生产计划(求总产品X和最终产品Y)。

请设计该企业的生产计划决策支持系统,画出DSS运行结构图,并对总控程序、模型程序、数据库进行结构和功能说明。

提示:

该决策支持系统需要利用3个模型(投入产出模型、线性规划模型和报表模型(打印投入产出表))和两个数据库(投入产出数据库和线性规划数据库)。

在DSS总控程序中要详细说明何时调用哪个模型运行,何时存取哪个数据库中的数据,何时进行数据计算。

该DSS需要两次调用投入产出模型:

一次计算中间结果,一次计算最后结果。

请注意,模型程序应该是一个标准程序,在一定的参数控制下,可得到中间结果,也可得到最终结果。

该模型程序既适合于该问题的DSS,也适合于其他问题的DSS,不能是一个专用的模型程序。

(40分)

1、模型

1.投入产出模型:

可以确定

的关系,

2.线性规划模型:

根据约束方程BX<=>h与目标方程S=∑Piyi→max可以计算出最优的yi。

3.报表模型:

根据最终产品Y=(yij),X=(xi)是企业总产品自动生成报表。

2、数据库

1.投入产出数据库

字段名

数据类型

长度

是否可为空

int

8

int

8

int

8

……

int

8

int

8

int

16

int

16

int

16

……

int

16

int

16

float

16

float

16

float

16

……

float

16

float

16

2.线性规划数据库

字段名

数据类型

长度

是否可为空

float

8

float

8

float

8

……

float

8

float

8

h1

float

16

h2

float

16

h3

float

16

……

float

16

hi

float

16

float

16

float

16

float

16

……

float

16

float

16

3、DSS运行结构图

2、考虑去卡拉OK厅唱歌的时候,是否要等待包间的问题。

规定如下属性可用于描述该领域内的实例:

(1)Others(其他地点):

附近是否有其他卡拉OK厅;

(2)WaitCond(等候条件):

供顾客等候的地方是否舒适;

(3)Weekend(周末):

若是周六或周日,则为真;

(4)Conssumers(顾客):

店中有多少顾客(值为None(没人),Some(一些)或Full(满座));

(5)Price(价格):

价格范围(值为Cheep(便宜),Middle(中等),Expensive(较贵));

(6)Raining(下雨):

外面是否在下雨;

(7)Reservation(预约):

是否预约过;

(8)WaitEstimate(等候时间估计):

估计的等候时间(值为0—10,10—30,30—60,>60,单位为分钟)。

训练集见表:

实例

属性

目标WillWait

Others

WCond

WEnd

Cons

Price

Rain

Res

WEst

X1

Yes1

No0

No0

Some0

EX-1

No0

Yes1

0-101

Yes

X2

Yes1

No0

No0

Full11

CH1

No0

No0

30-60-1

No

X3

No0

Yes1

No0

Some0

CH1

No0

No0

0-101

Yes

X4

Yes1

No0

Yes1

Full1

CH1

Yes1

No0

10-300

Yes

X5

Yes1

No0

Yes1

Full1

EX-1

No0

Yes1

>60-2

No

X6

No0

Yes1

No0

Some0

MID0

Yes1

Yes1

0-101

Yes

X7

No0

Yes1

No0

None-1

CH1

Yes1

No0

0-101

No

X8

No0

No0

No0

Some0

MID0

Yes1

Yes1

0-101

Yes

X9

No0

Yes1

Yes1

Full1

CH1

Yes1

No0

>60-2

No

X10

Yes1

Yes1

Yes1

Full1

EX-1

No0

Yes1

10-300

No

X11

No0

No0

No0

None-1

CH1

No0

No0

0-101

No

X12

Yes1

Yes1

Yes1

Full1

CH1

No0

No0

30-60-1

Yes

要求:

建立BP神经网络模型,并进行容错性分析。

(30分)

一、为训练集赋值

属性

值名

属性1

属性2

属性3

属性4

Others

A

Yes

1

No

0

WCond

B

Yes

1

No

0

WEnd

C

Yes

1

No

0

Cons

D

Full

1

Some

0

None

-1

Price

E

Cheap

1

Middle

0

Expensive

-1

Rain

F

Yes

1

No

0

Res

G

Yes

1

No

0

WEst

H

0-10

1

10-30

0

30-60

-1

>60

-2

WillWait

I

Yes

1

No

0

在Matlab的命令窗口中运行如下代码:

p=[110110000101;

001001101101;

000110001101;

010110-1011-11;

-1111-10101-111;

000101111000;

100011010100;

1-110-2111-201-1];

t=[101101010001];

net=newff(minmax(p),[151],{'tansig','purelin'},'traincgb');

=5;

=300;

=0.000001;

[net,tr]=train(net,p,t);

得到如下曲线图:

容错性分析:

实例

输入

输出WillWait

结果

Others

WCond

WEnd

Cons

Price

Rain

Res

WEst

X1

1

0

0

0

-1

0

1

1

1

X2

1

0

0

1

1

0

0

-1

0

不等

X3

0

1

0

0

1

0

0

1

1

X4

1

0

1

1

1

1

0

0

1

X5

1

0

1

1

-1

0

1

-2

0

不等

X6

0

1

0

0

0

1

1

1

1

X7

0

1

0

-1

1

1

0

1

0

不等

X8

0

0

0

0

0

1

1

1

1

X9

0

1

1

1

1

1

0

-2

0

不等

X10

1

1

1

1

-1

0

1

0

0

不等

X11

0

0

0

-1

1

0

0

1

0

不等

X12

1

1

1

1

1

0

0

-1

1

完成机器学习后,对样本进行改变条件输入,有如下3种情况:

(1)缺1个条件的情况

(2)缺2个条件的情况

(3)介于中间的情况

(1)

实例

输入

输出

WillWait

(1)

输出

WillWait

(0)

结果

Oths

WCon

WEn

Con

Price

Rai

Res

WEst

X1

1

1

0

0

-1

0

1

1

0.8456

0.1526

(1)

X2

1

0

1

1

1

0

0

-1

0.0723

0.9281

不等(0)

X3

0

1

0

1

1

0

0

1

0.8648

0.1352

(1)

X4

1

0

0

1

1

1

0

0

0.8634

0.1366

(1)

X5

1

1

1

1

-1

0

1

-2

0.2314

0.7686

不等(0)

X6

0

1

1

0

0

0

1

1

0.9125

0.0875

(1)

X7

0

1

1

-1

0

1

0

1

0.3410

0.6595

不等(0)

X8

0

1

1

0

0

1

1

1

0.9714

0.0286

(1)

X9

0

0

0

0

1

1

0

-2

0.4928

0.5012

不一定

X10

1

1

0

0

1

0

1

0

0.5681

0.4319

不一定

X11

1

1

1

-1

1

0

0

1

0.4123

0.5877

不一定

X12

1

1

0

0

0

0

0

-1

0.6428

0.3572

不一定

3、编制旅行商路径优化问题的遗传算法程序,并计算一个实例。

(30分)

一,问题描述:

所谓旅行商问题,即给定几个城市,旅行商从中选择一

条最短的路线,使他能够访问到每个城市一次,然后返回起

点。

二,运行结果:

三、代码实现

  下面是程序的主要核心代码:

usingSystem;

using;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Text;

using;

usingSystem.Diagnostics;

namespaceTSPGA

{

publicpartialclassForm1:

Form

{

privateWorld_world=newWorld();

publicForm1()

{

InitializeComponent();

}

privatevoidpictureBox1_MouseUp(objectsender,MouseEventArgse)

{

Pointpoint=newPoint(e.X/(pictureBox1.Width/200),e.Y/(pictureBox1.Height/200));

if(e.Button==MouseButtons.Left)

{

_world.AddPointNeedToVisit(point);

cityNum.Text=_();

}

else

{

_world.StartPoint=point;

}

ReDrawPB();

}

privatevoidReset_Click(objectsender,EventArgse)

{

_world.Reset();

ReDrawPB();

}

privatevoidReDrawPB()

{

Bitmapbm=newBitmap(pictureBox1.Width,pictureBox1.Height);

using(Graphicsg=Graphics.FromImage(bm))

{

intx,y,radix;

foreach(Pointpointin_world.PointsNeedToVisit)

{

x=point.X*(pictureBox1.Width/200);

y=point.Y*(pictureBox1.Height/200);

radix=5;

g.DrawEllipse(Pens.DarkCyan,newRectangle(x-radix,y-radix,2*radix,2*radix));

}

if(_world.StartPoint!

=Point.Empty)

{

x=_world.StartPoint.X*(pictureBox1.Width/200);

y=_world.StartPoint.Y*(pictureBox1.Height/200);

radix=5;

g.DrawEllipse(Pens.Red,newRectangle(x-radix,y-radix,2*radix,2*radix));

}

}

pictureBox1.Image=bm;

}

privatevoidpictureBox1_MouseMove(objectsender,MouseEventArgse)

{

Pointpoint=newPoint(e.X/(pictureBox1.Width/200),e.Y/(pictureBox1.Height/200));

infos1.Text=point.ToString();

}

privatevoidStart_Click(objectsender,EventArgse)

{

_world.Population=Int32.Parse(population.Text);

_world.Generation=Int32.Parse(generation.Text);

_world.CrossOverRate=Double.Parse(crossOverRate.Text);

_world.MutationRate=Double.Parse(mutationRate.Text);

drawVisitRoute();

//_world.Reset();

}

privatevoiddrawVisitRoute()

{

ReDrawPB();

Bitmapbm=(Bitmap();

using(Graphicsg=Graphics.FromImage(bm))

{

PointstartPoint=_world.StartPoint;

if(startPoint==Point.Empty)

{

MessageBox.Show("Youmustdefineastartpoint.");

return;

}

Point[]pointsNeedToVisit=_world.PointsNeedToVisit;

Stopwatchsw=newStopwatch();

sw.Start();

int[]visitRoute=_world.GetVisitRoute();

sw.Stop();

infos3.Text="Used:

"+sw.ElapsedMilliseconds+"ms.";

ListvisitPoints=newList();

visitPoints.Add(startPoint);

foreach(intindexinvisitRoute)

{

visitPoints.Add(pointsNeedToVisit[index]);

}

inttd=0;

Pointtp=visitPoints[0];

for(inti=1;i

{

td+=GetManhattanDis(tp,visitPoints[i]);

tp=visitPoints[i];

}

totalDis.Text="TotalDistace:

"+td;

for(inti=0;i

{

Pointp=newPoint();

p.X=visitPoints[i].X*pictureBox1.Width/200;

p.Y=visitPoints[i].Y*pictureBox1.Height/200;

visitPoints[i]=p;

}

g.DrawLines(Pens.SeaShell,visitPoints.ToArray());

}

pictureBox1.Image=bm;

}

privatevoidrandom_Click(objectsender,EventArgse)

{

_world.Reset();

Randomrnd=newRandom();

intc=Int32.Parse(cityNum.Text);

_world.StartPoint=newPoint(rnd.Next(0,200),rnd.Next(0,200));

for(inti=0;i

{

_world.AddPointNeedToVisit(newPoint(rnd.Next(0,200),rnd.Next(0,200)));

}

ReDrawPB();

}

privatestaticintGetManhattanDis(Pointp1,Pointp2)

{

returnMath.Abs(p1.X-p2.X)+Math.Abs(p1.Y-p2.Y);

}

}

}

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1