设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15208|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. F7 Y/ G9 B$ }9 K

  Z+ T$ _' m& p4 t; T我的问题是,在每个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中的数值,不知道会不会有什么不妥。( h( ~) y2 V$ K1 W+ m% B
" L3 m7 X$ J% e5 E0 V
begin P_read arriving
( U1 b5 ?* t4 q' }% B* y( Q    while 1=1 do begin! f3 n5 u  ]; A& D$ T! @) g! J8 T
        read A_tote from "data.txt" with delimiter "\n"
% K3 J) H: M$ i$ |9 t% u) ~        read A_time from "data.txt" with delimiter "\n"
7 B  i  |! O9 a: c        read A_leave from "data.txt" with delimiter "\n"+ ]: F. }9 `* e6 i! W' B8 O; d
        read A_picks from "data.txt" with delimiter "\n"
; j& v1 k. o3 o6 ]        set load type to A_tote, P" m- [; `% t. k* U; S
        if A_tote="tote 1" then set A_induct to 1, G7 }8 A8 Q: f: V6 x7 `- {5 p
        else if A_tote="tote 2" then set A_induct to 2
! r8 \: ]; D" m- D5 |% h% i. Y) ]            else set A_induct to 3      a* U7 P5 Q* a! y4 T3 r
        set A_i to 0! m+ z/ Y( x" {5 ^- z
        clone 1 load to P_induction8 k0 T& ?) o; ^  c9 B$ x
        wait for A_time sec0 e# D& T+ E" X6 Y
    end
5 u8 k% y1 p0 y) p' Yend7 }" m. ^% P4 t! ?

; N9 {9 [3 _  P) f1 f% K3 Vbegin P_induction arriving
6 {' S5 f' x! t    if A_induct=1 then clone 1 load to P_pick1
- h" n) N& r& u1 a8 n  H5 N" y    else if A_induct=2 then clone 1 load to P_pick27 X" P$ S4 l  v/ B: D3 F
        else clone 1 load to P_pick3
  g1 [( x& \: W! Tend/ }7 Q: V4 r; V2 _8 e& j; ^

# r; W5 I; \; h0 v' R& b% q+ m& Dbegin P_pick1 arriving
8 X3 D6 I  w. Y) ^9 a: d( V& V    set A_i to 1
1 }; T0 A7 \$ B    move into Q_induct11 F9 ?2 g) @. y, ~6 `. L
    move into pickaisle.induct12 n7 ~9 q2 g, O" e; i
    while A_i<=30 do begin
4 J$ g- t, ?8 \: b) i2 `        travel to pickaisle.con(A_i). ?3 j' ^: W8 U2 n" s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 O3 Q: f0 }( W7 N% b! ~9 b
        else wait for 10 sec! ~! k1 S( P. B8 H+ n
        if A_i=A_leave then send to die+ H4 r5 c1 W% r0 H7 n. J
        else inc A_i by 1
' k$ Y. w) {2 T/ W& ?    end
/ l0 H' {( {# h  j+ Vend
9 V2 n9 S0 f' z+ H
4 ^. T& ?" y+ J& Y. z1 Obegin P_pick2 arriving3 Q3 A: s1 Z  r* `. R: h  F
    set A_i to 112 t4 o" q4 y* M. X" ?0 J
    move into Q_induct2) ?: a. |! i/ T( Z
    move into pickaisle.induct2
( j. j; a: f% l' Z" P; {& T! Q    while A_i<=30 do begin/ v# q5 b6 P  {* R3 H- f  L* U; m
        travel to pickaisle.con(A_i)
! H! ]( M2 i2 G* R/ C% `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 U4 V% J% o; m% P        else wait for 10 sec
" w9 Z: H) F3 G' b9 I' Y        if A_i=A_leave then send to die/ D  `" c1 ?0 A
        else inc A_i by 1
& v3 t( S8 {7 }' v    end! @* e% P1 V4 Q7 e
end
+ z+ N  i! ?, Z: c! i# d3 v' W
$ H- F- F) L! N# w% Fbegin P_pick3 arriving
* P: o8 ^8 n& g8 @" e    set A_i to 21
3 @8 z! Q1 e" \    move into Q_induct3
0 Q0 o7 B* S  g- R$ |9 {$ ]& M+ V    move into pickaisle.induct38 T- b/ L3 D- ~4 J# d- f
    while A_i<=30 do begin
" P$ n: M0 \0 M$ N( ~. r        travel to pickaisle.con(A_i)1 Z  Q% A, [% V7 I/ L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- k* A. B- z- Y  d! W# s" B" L
        else wait for 10 sec
& q$ W0 \2 \: ^. y        if A_i=A_leave then send to die
. ]  k' u* w) ?4 M        else inc A_i by 1
  ]. R5 p: `# h% S4 G    end
" \( r6 L0 j2 L- A2 ]end

最佳答案

查看完整内容

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是个什么东东?
% K$ w1 s% d6 o2 ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 p/ V% P8 o# J* C$ X; x( r4 Y
' I: w& q' C% ~0 `; q  ~7 d8 Y6 t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 |: \/ l/ a/ l5 @& H
! E3 z8 @/ I* X- l, b% E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( a* ^" |8 j& d2 D3 p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 C- T) Q+ L+ G0 b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ |" D* y( Y0 T/ l# p6 Q& t
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 V" K1 q! D* ]- ]3 p/ l% A* @- zbegin P_induction arriving& k& Y) e: g5 v! z) a
    clone 1 load to P_pick(A_induct)* I% k# ?0 E8 r! G, B
end最大的系4 Y  f$ l7 D9 p% Z; d, g( G

( t2 v  T, }' Y3 o$ t" p9 k* p* |begin P_pick arriving
5 e4 K# ?3 B1 c8 g0 t    set A_i to procindex * 10 + 12 z$ q( C+ [3 M/ U, a% ?- j; z
    move into Q_induct(procindex)2 B1 C9 i  W" f0 G/ \
    move into pickaisle.induct(procindex)5 U$ B  p% Y7 g
    /*check the type of pickaisle.induct(i), for your last problem.*/
) z  ]% Y2 ^3 Y8 H7 Z
; f1 \  [6 A) j. R- b. B' z/ Q    while A_i<=30 do begin
2 j+ {. F1 V* N$ B        travel to pickaisle.con(A_i). g* J" _' q9 S9 b4 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u. z7 R. R. G5 v        else wait for 10 sec$ m2 B2 X0 C- S3 O
        if A_i=A_leave then send to die
& |( Z/ z5 k0 L        else inc A_i by 1
7 h# h+ W" S9 p- D2 s9 M    end+ U' |: h" p/ e
end8 x2 A# U8 m" l9 M# w$ L8 N7 F

! d2 j6 H7 N6 _  F! a. W) `其中的procindex为整形,代表当前process的序号。
! f, ]  o$ T; Q- T4 R3 C8 ]station和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-8-24 00:16 , Processed in 0.018255 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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