设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12126|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- F9 |* D* ]8 ^( a3 b2 ]% m1 r  O
/ U/ ^) v! W9 L% J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ b. @. Z" F  I0 N+ O
- O: d- D/ z9 b. G+ }# n0 C
begin P_read arriving" z) r/ x  n- n/ t
    while 1=1 do begin% P0 i% \$ U; C
        read A_tote from "data.txt" with delimiter "\n"
: _% w# H  Q- h" `# l) L+ ?        read A_time from "data.txt" with delimiter "\n"0 e3 t1 O  f* h. z8 @
        read A_leave from "data.txt" with delimiter "\n"
1 `* X4 N& x" `& }8 L6 m5 l- b+ U        read A_picks from "data.txt" with delimiter "\n"
  ^0 N4 c$ K/ W; k8 t        set load type to A_tote  G. T# d: S  C* t) j8 D9 M
        if A_tote="tote 1" then set A_induct to 1
$ l3 R$ i% _0 m& W% l        else if A_tote="tote 2" then set A_induct to 2
- r  I; O% _/ t  y            else set A_induct to 3   
6 V/ F" b' `5 S6 l+ h/ {- F: W        set A_i to 0' h5 y4 v  E2 j# Y4 X
        clone 1 load to P_induction" ]; z+ ~, D! |) I" X
        wait for A_time sec
+ d! v' D2 m7 T( r; X2 P    end
9 S; }: R, k: w. H7 yend
9 U$ y" l" q- \, y2 G% G. j: c% z8 w/ [5 |+ d2 t& S
begin P_induction arriving, \4 h  {' R! k, s7 S3 p1 d, O
    if A_induct=1 then clone 1 load to P_pick1( U! Y9 y" ^7 Z. G% f- `! O: c
    else if A_induct=2 then clone 1 load to P_pick2
) G5 ?+ f6 t5 n8 l& r9 r9 T0 X        else clone 1 load to P_pick3
% B7 u0 V' ]6 b1 v- ~  \5 X2 Tend
' S# E+ y, J" F- }
% X+ d' g, i3 X0 r7 P- |begin P_pick1 arriving
. n$ e' @# ]2 F: V6 k    set A_i to 1
. L$ k5 W7 B# J  y    move into Q_induct1/ m9 s4 ~0 Q2 x
    move into pickaisle.induct1& ?, n. p2 c5 u7 O( p' J
    while A_i<=30 do begin
6 \+ ~$ v* l# ]9 |' _# i        travel to pickaisle.con(A_i)
( A  y6 m, A, [; s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" M8 ], Z/ v1 c! i6 j        else wait for 10 sec
+ i- K5 K5 {/ ~1 ?9 k) O        if A_i=A_leave then send to die- [- y# U/ J1 u0 W- H4 i
        else inc A_i by 1/ A7 ]& m  V5 I: N0 [& d& q& t
    end
& f% W* v+ j1 _, M5 rend8 e; R) W6 U( P' n

- ~& [3 Z6 L  H7 nbegin P_pick2 arriving
3 h0 a0 y2 P# v0 ~    set A_i to 11+ x6 B; q) s# f+ [  e) z
    move into Q_induct2
: l/ l  B1 D- U& y* J7 \- L    move into pickaisle.induct22 w7 R; A+ d: D# o, j7 e% c
    while A_i<=30 do begin/ t% M  ^* J6 ^$ y: ]2 @
        travel to pickaisle.con(A_i)1 _( C- P4 V* |2 r8 D. L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# }0 ~7 X/ m6 U: l1 p8 P9 c        else wait for 10 sec
2 o8 A  H' m2 u5 u/ ?- [        if A_i=A_leave then send to die
/ @3 i3 k6 |, v$ Y$ g( r( @" I        else inc A_i by 1
5 o) V, p, |! s/ e. J+ e1 h2 @    end
  j# ^0 ?& |( |/ ^1 r/ `end, f4 k& _5 s- M7 z' |& u# X

, n, i9 a/ V% A" k4 b' jbegin P_pick3 arriving
3 ^. n, v- Q' M1 W' g/ j2 w7 u    set A_i to 21* S* G. m8 [1 ?( M! q9 I
    move into Q_induct3( i" Q) P5 @* @( q- z
    move into pickaisle.induct3* @' a9 N+ p* ?$ n. c8 ]8 f" x5 O
    while A_i<=30 do begin
  W  S* j4 i% d3 z8 {' d        travel to pickaisle.con(A_i)
0 S* R* B. O- ]8 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: R6 f  B7 `& r8 g. y7 A* L
        else wait for 10 sec) i0 o0 W2 ]% c6 k' H- U; |" e- k" b
        if A_i=A_leave then send to die
- h" t, y; A+ E% V        else inc A_i by 14 p- n, D+ ]3 D1 p4 Q8 z+ a. k
    end  N7 `) z- n- R6 _7 r1 W% S. z
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# g; H3 E( F& x0 {' x6 K, y, J  G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  D: t8 q: \9 t+ \# x1 h4 _

% N- O/ i, m! y2 L' @. mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% N2 e" ]* r& ^( l6 N/ k
" E2 ^+ q1 l! K& e3 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% f& E3 _8 E+ f, b! x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- P4 G7 P" L2 ?- ?2 E3 I2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 Y8 x. T0 I, z+ |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 F. p" w& D' p% x. q
begin P_induction arriving
3 @* [: [: w1 \7 l6 M& b* u    clone 1 load to P_pick(A_induct)
& x9 {) G4 T1 L+ I3 q' |3 send最大的系
  E% E- C' U5 h# ]5 o) g
) T  V, I9 o3 m4 `* `5 Hbegin P_pick arriving
  Y  i  g1 @2 D& r2 Z    set A_i to procindex * 10 + 1' o& s3 n4 s/ D& T. }' q
    move into Q_induct(procindex)
( s, O, u( v* O: z    move into pickaisle.induct(procindex)- o3 }0 }  g5 z+ B# f9 y# I  }! H
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 H1 C, T; e1 \7 L; i7 r& Y& l3 M+ ^" J+ A' ]9 E2 W
    while A_i<=30 do begin5 l5 M; M3 X9 F# K) y% m
        travel to pickaisle.con(A_i)
& G1 |5 j. h+ J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ m0 a0 N+ |4 F4 v9 r$ D        else wait for 10 sec5 l9 _$ V) y3 k& R) E& Y. d
        if A_i=A_leave then send to die' M4 J4 V7 _% j* E
        else inc A_i by 1
7 k6 N6 j. H0 t2 q% d8 U' ^' \' a( U. O    end+ {- P/ j6 A6 Q* u% r
end
4 v  \8 ?6 _8 u5 s9 [% z$ c9 Z7 ?3 o) V5 q4 t6 u
其中的procindex为整形,代表当前process的序号。: N) n" ^5 e1 f- r, y# g1 u, ?
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, 2025-12-29 18:12 , Processed in 0.019342 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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