设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12779|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 l5 l( p2 `& {  l- Q+ v5 ]! R- l; |$ S8 B6 h
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。, l: ^5 d" ~4 ^5 p5 e
5 H( T( m$ ?. c- y2 @5 {
begin P_read arriving
: F7 s" d2 C2 w; _+ i    while 1=1 do begin3 U5 Y" }+ K$ m" l1 P1 H) d
        read A_tote from "data.txt" with delimiter "\n"( F4 C/ J0 C+ Y( t- O; ~4 `- S
        read A_time from "data.txt" with delimiter "\n"
1 d) s# d$ Q7 m& ?+ _' q- B( T$ j        read A_leave from "data.txt" with delimiter "\n"
) u. ^4 p/ L' f+ e+ E% D, a4 I        read A_picks from "data.txt" with delimiter "\n"
" u, V! R9 M7 i        set load type to A_tote5 k8 z$ O2 ~& X* B
        if A_tote="tote 1" then set A_induct to 1
+ k# d  W7 T. Z8 ]4 h2 A8 r# ]        else if A_tote="tote 2" then set A_induct to 2
9 X4 z/ v' j! c4 q            else set A_induct to 3    1 w6 ]$ d7 f# h9 B0 U! x" l
        set A_i to 0$ N2 K) G& o5 @
        clone 1 load to P_induction8 J9 ]- L& Y' K1 F; i
        wait for A_time sec
/ a/ x1 i" [, T( I# s    end
2 ?0 Z" x' l1 j* xend2 [& q) [) D7 U# O6 D+ Q- Q6 L

: X0 i/ H! x, S4 c! i, H) p7 Kbegin P_induction arriving: {6 j- l1 \: M. L; q" a
    if A_induct=1 then clone 1 load to P_pick1
. j, e/ N5 `+ ?: N% ?    else if A_induct=2 then clone 1 load to P_pick2
+ {7 p( G3 I, K- R) _        else clone 1 load to P_pick3
1 P9 y; x: p8 S3 @7 s% i( f% U) Tend
; C0 H2 s' q% ~9 f1 w0 |; l9 W9 e7 F/ a2 I7 J& x
begin P_pick1 arriving. [" a' ]; M$ Z  \6 K8 O- a1 J
    set A_i to 1, h2 e' S5 R- \: w5 o1 Q
    move into Q_induct1
! L; D3 O! ^* m: N$ l/ N- U  R' k9 C    move into pickaisle.induct1
. Y) T$ w5 M2 x2 f    while A_i<=30 do begin$ ]% e1 t( H4 Y: b  @+ B
        travel to pickaisle.con(A_i)
. K& ]$ w3 `$ W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ w) g2 e* b. H: O3 Z' N8 s        else wait for 10 sec- U3 y6 Y6 j: S4 H! Z, z5 D6 J+ d
        if A_i=A_leave then send to die7 m& ~4 q. }& G/ P& N8 ~: [' K  J
        else inc A_i by 1( E5 [1 e# a) |
    end4 S$ w% ^6 ]" q9 F/ n
end
, F* M$ f3 k6 n3 d8 p3 ]& m
/ f9 X6 S; _( f6 k5 q! `7 O9 ]begin P_pick2 arriving( \* C2 p: F; c1 y4 r; V- ~! W
    set A_i to 11
& k- Y% r4 U) x/ l    move into Q_induct2
' Q( Y- d6 x+ Y6 m9 u1 E    move into pickaisle.induct2
6 L* [" \3 z- _' K& ?% r) w    while A_i<=30 do begin2 C- g/ E8 {7 q# M1 @! i
        travel to pickaisle.con(A_i)
2 I5 k& l' r- `  Y) D  Q& N: o3 l4 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Z; W5 U; n/ [! O
        else wait for 10 sec
& ^- l, @+ [5 d& ]& L        if A_i=A_leave then send to die
+ G: O9 w& y9 @# @        else inc A_i by 1
& M5 \: G# l; o, o; C3 u* ]    end  p6 l! F7 v: ^/ S) }: C7 _
end" `1 S- }3 ?# E3 o( ~6 V! |
& c8 a# u5 F# f$ B$ i7 s" {
begin P_pick3 arriving
1 Q% r' ?& \6 i+ S! m1 t8 p    set A_i to 21) x. B3 n; Y% o# t+ [4 h- P
    move into Q_induct37 G* |9 |% H! x
    move into pickaisle.induct3
$ _6 D  g) J1 S- ~    while A_i<=30 do begin
8 t# B) D3 ^$ r6 y        travel to pickaisle.con(A_i)9 _$ d$ @. R" X5 k0 D) o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 i' B. X; ^/ |' w7 j  d' I' r, Y
        else wait for 10 sec" u. _2 _# t# [% y6 q( ^/ O3 A
        if A_i=A_leave then send to die/ O3 a# m7 E  i; s) }
        else inc A_i by 10 N3 O; k  b. g) N6 W
    end
- B, A" S. X' a" H+ hend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?3 D3 V4 ~& O8 ]! ]& Z; ]% V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ w7 ~6 U: ?- p& E5 ?9 Y0 N8 G) h
4 |# h- e- p- v7 C7 m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# [/ V/ y3 ]7 @. V! V

' C$ ~; i, Y2 r& q% h6 g4 V/ j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 i. P% }; A: a( `/ I+ s1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. F: B$ X8 t0 L3 z+ K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( ^5 b- h: m. {8 r# ^7 \( E0 m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  y4 b* S2 E0 E1 s! Dbegin P_induction arriving0 {6 j9 E9 G) Z0 @5 l: O
    clone 1 load to P_pick(A_induct)
- }* S$ r+ s( |2 _, bend最大的系- v3 d# X2 y4 l: L3 J! C! Y9 P( U: }$ N

' D0 h" t. d' ~# X" P) n: ybegin P_pick arriving& U, w# G4 @/ Z1 z6 O
    set A_i to procindex * 10 + 18 k. H3 y, W' N6 t/ f. ^9 J
    move into Q_induct(procindex)
+ V4 L" o0 c. z6 Z' n9 I! P6 u    move into pickaisle.induct(procindex)3 A! j1 K; C& z& l
    /*check the type of pickaisle.induct(i), for your last problem.*/
: ?, s7 ]* a) K2 w5 T6 m/ o* W' n6 x) @6 B+ r# {* s2 y2 V
    while A_i<=30 do begin1 r/ {9 ~6 Q, V2 u/ s4 O  g/ Q$ C
        travel to pickaisle.con(A_i), K/ Q; C+ c; |- Q9 O- p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V" }4 @+ [! V; t' `1 ?
        else wait for 10 sec
- j8 v$ i. ]+ V# p" ~) M        if A_i=A_leave then send to die
2 J$ [0 }2 i3 C2 A6 {* V1 m8 k        else inc A_i by 1- X3 R5 v6 [- x4 ?- o- ^$ n
    end% U/ Q) ~+ L" I( h$ R
end
4 E$ q& v5 L* |. {, Y6 y0 t8 M1 W0 M$ w
其中的procindex为整形,代表当前process的序号。
$ P7 b' J, o! v- Ystation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-2-19 22:41 , Processed in 0.023291 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表