37
00:02:26,000 --> 00:02:32,000
接下来,我们看下一个知识点,就是决策
38
00:02:32,000 --> 00:02:38,000
就是令牌的一种什么,
39
00:02:38,000 --> 00:02:42,000
一种分流,
40
00:02:42,000 --> 00:02:47,000
它走哪个流,
41
00:02:47,000 --> 00:02:52,000
决策点,一个入多个出,
42
00:02:52,000 --> 00:02:55,000
令牌流进来,
43
00:02:55,000 --> 00:03:00,000
然后在这里根据条件做分流
44
00:03:00,000 --> 00:03:03,000
符合条件走这边,不符合走这边
45
00:03:03,000 --> 00:03:06,000
当然可以多个,可以有条件1,条件2
46
00:03:06,000 --> 00:03:09,000
再加一个else
47
00:03:09,000 --> 00:03:11,000
这里只列了两个分支,
48
00:03:11,000 --> 00:03:14,000
也可以三个,多个分支,都可以,
49
00:03:14,000 --> 00:03:17,000
那么这些条件必须能够保证什么,
50
00:03:17,000 --> 00:03:24,000
有且只有一个出边上的条件为真,
51
00:03:24,000 --> 00:03:28,000
肯定要有一个,它令牌流出去
52
00:03:28,000 --> 00:03:30,000
而且只能有一个,不能多
53
00:03:30,000 --> 00:03:39,000
不能说这条也行,那条也行,那不行
54
00:03:39,000 --> 00:03:44,000
只有一个出边获得令牌
55
00:03:44,000 --> 00:03:46,000
比如说,像这个就类似于什么,
56
00:03:46,000 --> 00:03:50,000
用文本的代码的if条件
57
00:03:50,000 --> 00:03:56,000
A1,else A2,类似这样
58
00:03:56,000 --> 00:04:00,000
那么跟决策点对应的就是合并点
59
00:04:00,000 --> 00:04:02,000
你看,这个
60
00:04:02,000 --> 00:04:05,000
你看,这里是一进,这是入嘛
61
00:04:05,000 --> 00:04:08,000
这是出
62
00:04:08,000 --> 00:04:13,000
这个是入,入,这个一个出
63
00:04:13,000 --> 00:04:18,000
合并点就是多个入边,一个出边
64
00:04:18,000 --> 00:04:22,000
它的目的是把这个令牌
65
00:04:22,000 --> 00:04:29,000
重新收进来,变成这里出去的那个令牌
66
00:04:29,000 --> 00:04:31,000
那么把
67
00:04:31,000 --> 00:04:34,000
决策跟合并这两个菱形
68
00:04:34,000 --> 00:04:37,000
要成对匹配
69
00:04:37,000 --> 00:04:39,000
这是一个好习惯