Transcript Document

团队课程演讲——(一)
UML单项练习1——概念类图
小组成员:苏嘉铭 杨媛媛 夏敏 吕芙洁 张天意
UML练习
概念类图
1 Priest VS Devil
牧师与恶魔
Question : Priests and Devils is a puzzle game in which you will help
the Priests and Devils to cross the river within the time limit. There
are 3 priests and 3 devils at one side of the river. They all want to
get to the other side of this river, but there is only one boat and this
boat can only carry two persons each time. And there must be one
person steering the boat from one side to the other side. In the
flash game, you can click on them to move them and click the go
button to move the boat to the other direction. If the priests are
out numbered by the devils on either side of the river, they get
killed and the game is over. You can try it in many ways. Keep all
priests alive! Good luck!
题目:有三个牧师和三个魔鬼在河的一
边。他们想到河的另一边去,可是只有
一艘船,这艘船每次最多只能搭载两个
乘客。要使船从河的一边到另外一边必
须,船上必须有一名乘客来掌砣。如果
在河的任意一边,恶魔的数量大于牧师,
牧师会被恶魔吃掉,游戏结束。
UML练习
Object Oriented Analysis
对象
3个牧师,3个恶魔,1条河,1只船,2个岸
1
类
牧师,恶魔,河,船,岸
UML练习
Object Oriented Analysis
1
如图可知重要的有4个类
牧师类
恶魔类
河岸类
船类
UML练习
系统状态模型分析
1 系统状态模型分析
Priest VS Devil 牧师与恶魔
UML练习
1
系统状态模型分析
先考虑一共有多少种状态,再
考虑状态间的转换。
首先按照河岸人数的分配状况
来分可以分出16种状态。
UML练习
1
系统状态模型分析
若标明船在河的哪一边,则有
约32种状态
UML练习
1
系统状态模型分析
最后形成的状态转移图的表格
形式如右图所示。
结果是一个有向有环图,把每
一对对应的来回边变成一条无
向边,使其变为无向图。
谢谢
演讲内容
UML单项练习1——概念类图
小组成员:苏嘉铭 杨媛媛 夏敏 吕芙洁 张天意