设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12473|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- p- p+ y6 a+ \, f9 t
: h0 ^% p% a; [4 g
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* _1 o! z' m) S& u7 w+ j
( C/ M% q- H7 D8 ^7 e
begin P_read arriving8 s* v: E4 y4 ^1 k
    while 1=1 do begin
1 B  d. ~9 @9 A9 J! X3 {8 \        read A_tote from "data.txt" with delimiter "\n"
* J9 D5 m' i  v0 C7 W/ D. ~& y2 w        read A_time from "data.txt" with delimiter "\n"8 }9 b: A0 Q4 |0 R+ O7 C! l+ ~
        read A_leave from "data.txt" with delimiter "\n", U" q6 Z6 m  [% n1 C
        read A_picks from "data.txt" with delimiter "\n"
* V6 {5 j3 M# t+ V0 U& O        set load type to A_tote) I4 _+ ?- \5 `: W$ A4 d3 L
        if A_tote="tote 1" then set A_induct to 12 [" O8 ]* c! \' b' R
        else if A_tote="tote 2" then set A_induct to 2
$ u- n. [) n- G2 x. u3 [% o            else set A_induct to 3    # F' J  E( _( n3 H( w0 `- Y; s! {, q
        set A_i to 0
2 d& H. s& R+ U# V        clone 1 load to P_induction) `, X+ [9 l  @% S  ?3 F* M
        wait for A_time sec# W8 T6 B5 X% r
    end
" q. I! b1 S$ U5 V# p0 vend( u/ o; C/ ^/ \3 D
  s6 z6 _# V% S, \
begin P_induction arriving$ Y& U7 h. C! M1 ~% {+ A
    if A_induct=1 then clone 1 load to P_pick1
$ w* ~1 `, f- B, \; N    else if A_induct=2 then clone 1 load to P_pick2
+ t; I2 K. A! ]+ U9 v  J        else clone 1 load to P_pick31 x# ]7 `( p. ]9 C
end) ^" ^* Z3 s) V

# D# u+ W, t& gbegin P_pick1 arriving
, w- K: g/ \* `2 x! w3 Q    set A_i to 1+ {4 E; @' O. I( u, X/ n
    move into Q_induct18 v$ p" l9 Y1 C& R5 w6 o& j
    move into pickaisle.induct14 o2 d  V) T. N5 ^+ f: G% p
    while A_i<=30 do begin! _. Y7 W) c" O
        travel to pickaisle.con(A_i); x: s; V& J/ Q5 i" m/ Z5 B4 D+ @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x* b5 K  V  ]        else wait for 10 sec
7 a+ C  ^5 ]' j. ]; [) \        if A_i=A_leave then send to die
# s' g7 A8 U, a& R        else inc A_i by 1. D/ i4 L% W9 V/ P6 @
    end
1 L/ I7 ^$ I1 r1 tend
6 C% r% l8 G: x8 ^4 Q9 ?! {- ~" a, C. s: ?4 k
begin P_pick2 arriving
: `$ N* t% G0 B' ]5 X. `  j4 J* ]    set A_i to 11# j) ?0 H% N+ I# q  u
    move into Q_induct27 v/ v% c; {2 C! y+ C" Y
    move into pickaisle.induct2
; L  B: U" B% e8 G! B6 H. R    while A_i<=30 do begin
" ^" Z( Z% V* o+ v5 w$ b% u        travel to pickaisle.con(A_i)
4 d, [6 z3 f! F1 b+ M( u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# s! V6 O$ k$ N/ `  Z
        else wait for 10 sec
3 a  m& T( I. Y: B, C        if A_i=A_leave then send to die
  f; I$ K! P1 C! ]        else inc A_i by 1
" o; F# W' V$ y4 X( s; P    end% [5 p$ K' y4 y* B. }
end
& c% i7 n+ ]! E0 J9 n0 H
: C+ o5 w) s( q6 dbegin P_pick3 arriving
- P! j0 h+ T; b' y) n+ e8 f* p7 @    set A_i to 212 {* f9 @$ A" j" r; w. S6 D
    move into Q_induct3
8 Y  O" B" Z0 B# |& l7 T    move into pickaisle.induct3* U; b  k" ~" a& [5 L
    while A_i<=30 do begin
  Z9 X- _* r- f5 ?$ `4 k+ q4 b1 L" |        travel to pickaisle.con(A_i)! V( e( a) D$ W  b- F& l/ f% I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& A/ X$ O; b0 F& \0 N% }        else wait for 10 sec
$ u, E. {( p* m# j        if A_i=A_leave then send to die
1 w  R: i" c5 @$ ^3 y        else inc A_i by 1+ ^6 m5 b$ W1 Z: D( U
    end' Q% x1 M$ y* {1 ~  q% v
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是个什么东东?! P% q- {+ Z$ a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 ~/ w- @( p% L  |: }3 n( \& q: I8 Y
1 {0 D. ]9 ]) m8 L/ y5 w9 }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- ~: e0 X$ K6 B9 \+ `; d5 u' |6 a$ c4 m5 V. ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. S9 l+ I& |; `: O0 H* ^. b/ W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' v: @' B6 L* \( s8 W) Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" j- ~( S$ K2 R8 ^  m+ c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ F- x! {8 W* e2 sbegin P_induction arriving
: ^- Q& }3 L5 A+ J1 y7 Q; N% L    clone 1 load to P_pick(A_induct)3 {# U# }! p+ A6 f# H
end最大的系  B% X# x. r# x+ y( S  J) y3 a$ X% |

3 D- o/ c8 z. Q5 Qbegin P_pick arriving) X6 |9 _9 l2 e0 \4 n) V
    set A_i to procindex * 10 + 1
) z, o4 T- ?+ ~  R: a3 G    move into Q_induct(procindex)
2 ~, J8 ]; t% S    move into pickaisle.induct(procindex); t! Y% L6 Z  k' e. E: @: t; \
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 N- j. o4 B/ x( P2 ~
3 p* O9 W' x0 v; b    while A_i<=30 do begin
8 C7 V  {# j: O! O7 c$ F        travel to pickaisle.con(A_i)
  F* v5 J( ?# K' ?9 z/ c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; p9 I' V& q# f% H/ T
        else wait for 10 sec7 G, {' D+ T  W) y* U
        if A_i=A_leave then send to die
" J9 P! i' j! T# i9 ^0 \8 _        else inc A_i by 1$ c$ K6 l0 D! p
    end- ^$ L0 K; r$ }9 ]# V, ^
end
* B* i3 T& l; S8 P  _7 x6 b6 ]  Z8 K4 A' ]" L% t
其中的procindex为整形,代表当前process的序号。
+ m* M- c2 m" k; Xstation和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-1-26 18:22 , Processed in 0.020899 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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