设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12700|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! {- O8 y' W: ]! Y* C) p  y
( o3 g: h. i3 b- R9 l: M) }& Y3 Q9 V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, J: l* B$ d" U- y3 c3 P
- e2 r/ @- S( r" F  A% f) ?+ `2 U
begin P_read arriving
2 H$ Y! h/ q; m& W    while 1=1 do begin
9 G- K+ Y! ]6 h" b) E        read A_tote from "data.txt" with delimiter "\n". N- I: d( I8 n0 _) @
        read A_time from "data.txt" with delimiter "\n": i5 E1 d$ G8 s2 Y0 O, j
        read A_leave from "data.txt" with delimiter "\n"
1 Z. n; t. `8 j4 e        read A_picks from "data.txt" with delimiter "\n"
9 z4 t, q( P" j' u3 [$ H        set load type to A_tote
4 k; h7 V& _9 n5 X+ o$ ^. ^        if A_tote="tote 1" then set A_induct to 1; x$ Z& ^: c; J4 N9 K
        else if A_tote="tote 2" then set A_induct to 26 ^% W& c; t1 g1 W6 J9 N; N0 N$ ]
            else set A_induct to 3    1 l0 l5 H( G5 F) B  w: `
        set A_i to 0
2 B5 Q  o: [) l- \! X& Q        clone 1 load to P_induction
2 e* r6 n4 Y+ t1 r9 N2 ]! I        wait for A_time sec; k% c" u9 n' q8 d+ c
    end( P' W, E9 g# e6 f  f1 p. c
end3 L1 q. k" [8 |3 h6 N9 ^! X- g" t
8 f4 w, r; Y# }, W% z  Y
begin P_induction arriving
7 _! x& `  v& f- K; Y& B& I# s    if A_induct=1 then clone 1 load to P_pick1
7 V3 f3 Z+ @" D! W6 T3 i- Y    else if A_induct=2 then clone 1 load to P_pick2
9 Z+ ~; x9 j2 Y        else clone 1 load to P_pick3
  Y* b. W- G  H5 S5 ^end
' d! y2 x1 k  K  j% {( V6 Y3 w# ]$ a( F8 |
begin P_pick1 arriving3 T; a) U7 f1 O' i* m+ v3 [) N/ G6 O
    set A_i to 1
( S0 b6 ^7 m- ^' m- p    move into Q_induct1
1 R6 T7 ?( V+ f* ~+ @    move into pickaisle.induct1
& R! B5 |+ {- x/ w5 Z" w    while A_i<=30 do begin
7 _# J# X4 \, C1 e6 V5 t8 F; l        travel to pickaisle.con(A_i)* h3 L4 F1 f, A7 e: U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  x5 ^5 A' Z$ c4 j1 x2 X2 @        else wait for 10 sec
# U( o) H; Q  }! h. y) M, Q# R7 U* \        if A_i=A_leave then send to die( W4 R) d8 Z0 @( T, u
        else inc A_i by 1
/ Y0 A" b% W5 L- `  Z    end3 d0 R0 L% r9 n0 V' Q* k
end' o0 Y7 J8 l* K7 t+ t3 U4 ^/ m1 [/ ~
1 [( `2 P% F8 Z8 z
begin P_pick2 arriving" v  E! X! H& B  Z) b) h8 }
    set A_i to 11+ Z$ {4 z* i. Q
    move into Q_induct27 O8 p' ?" [0 }7 `6 a# I* P
    move into pickaisle.induct2
* U% C: _9 |3 M    while A_i<=30 do begin
/ P. i) O0 ^% ~% u/ ]3 F; T        travel to pickaisle.con(A_i)" s! L% Q/ k( N9 N# y9 j2 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' B& @& @9 k# c& h" B
        else wait for 10 sec4 g2 g& `4 n7 p4 I  {3 J5 @
        if A_i=A_leave then send to die0 {, I( x& h3 C8 g& ]) T7 k
        else inc A_i by 1
! c- x) I" W# q; y* p8 U& X" H    end
) C% u; m6 `3 K! F/ l$ send- U% H. D8 x; e8 g
1 j# _1 O6 J7 y
begin P_pick3 arriving0 B; _+ t+ ^  w0 ]$ s
    set A_i to 21$ M0 x6 x8 K) ]0 S* T, {; U
    move into Q_induct3; A2 R6 v+ ~* F* F3 \4 v& e/ y
    move into pickaisle.induct3
* b6 b- J8 q9 a! t4 T+ o# M2 O    while A_i<=30 do begin
: A  ^- w; }) B( i/ Y        travel to pickaisle.con(A_i)
% ^* v, C, L1 c2 ^% l  `. \! H4 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, |" ^- X% K7 }# u, [4 F
        else wait for 10 sec' G- A% z0 M5 K$ r4 i
        if A_i=A_leave then send to die
; z2 E0 E! U) Y* k* U3 ]# V5 v        else inc A_i by 1# |# e3 R3 U; ^; W2 Q
    end
+ B7 S1 I' r, ^0 tend

最佳答案

查看完整内容

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是个什么东东?8 e* U/ t( ^- U2 Z/ P& R, _% G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( G% K8 Z8 k) ?) }! I2 _# v0 j! {1 ~4 m# @
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 Y& s% Y" H. b$ F
+ a2 G: D  ~0 Q  g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; ]6 L% N0 ^' v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! Y. f- |4 j- _; Z8 x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- P/ v# x) c  K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 r* b/ o0 n$ S' d% a2 L; J3 Rbegin P_induction arriving
& u4 c, ?& v+ y+ l4 N. m    clone 1 load to P_pick(A_induct)
  x1 X; x  e! R5 {end最大的系6 Q6 B" M5 e* E! T2 h8 W' Y

% z* N. A4 {& I% i+ o/ {/ cbegin P_pick arriving
" N2 d. n6 \0 k8 m3 d    set A_i to procindex * 10 + 1/ L# V% @8 r  ^2 i& ]1 I8 B% h
    move into Q_induct(procindex)
  c7 F) T9 r6 _& g) J* `    move into pickaisle.induct(procindex)
, n. A* W7 v* O5 J! g    /*check the type of pickaisle.induct(i), for your last problem.*/
! R4 p. k# _+ Q. W# D2 P* g$ A! y# P, C; m- W. W; D" H
    while A_i<=30 do begin& i. Z0 b% [$ B9 B6 u* S8 M. M
        travel to pickaisle.con(A_i)
. K, J* d  U- u3 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; D* i  B* T* [) q1 a  s) T& S: I3 J" ]9 \
        else wait for 10 sec
% X5 ]4 ?/ P  z9 j        if A_i=A_leave then send to die7 I) J- Z* j% \; e3 O$ _
        else inc A_i by 1
8 G1 s; I( l4 Y" v1 S1 J- R6 _    end0 |& G1 O0 P4 Y: v; i9 [
end) [- Z' M3 L3 P- ], Z7 B/ d

: d# c' A  d- x  v2 k- c# E* g其中的procindex为整形,代表当前process的序号。2 M- x7 B" `% V3 C6 y" g  s
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-2-12 11:32 , Processed in 0.015935 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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