设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9857|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ?. l; Z, T+ X1 B- }* ~0 e
1 h! c. o' C4 G5 Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! P) @3 S' e5 x' T) k
+ j9 N& g' C6 X- C3 V1 Y$ Sbegin P_read arriving; @6 n1 Z9 ^: s: \9 L: B
    while 1=1 do begin
- I0 a4 |( c- X3 B( T. n3 i3 q        read A_tote from "data.txt" with delimiter "\n", o+ K6 y. m7 g7 }: }7 L
        read A_time from "data.txt" with delimiter "\n"
! I* Z' G$ ~9 L        read A_leave from "data.txt" with delimiter "\n"
9 L2 @) U5 L' ?. Y        read A_picks from "data.txt" with delimiter "\n"
2 q% ~$ U& w- p3 P        set load type to A_tote
" A9 Y" [+ e) U% g5 k7 M) r        if A_tote="tote 1" then set A_induct to 1
  P5 c2 l  z. y8 X3 G. n        else if A_tote="tote 2" then set A_induct to 2
* A' c) n8 {- ?- K# I% f& ?" V            else set A_induct to 3    % E  ]& {. ?9 [" Z% W1 b
        set A_i to 0
1 x$ D" I" j6 ]  y" u0 f' G        clone 1 load to P_induction
9 {# A$ ^# V7 J( u! |1 y* k5 R        wait for A_time sec! A- J/ Y- ?% `) q
    end
# v' _( L: d8 a( D& b6 ?! w5 k% kend
4 H1 A* Q9 Z* n
; f3 K1 M; l) r* fbegin P_induction arriving# S) N' c' o4 \" D- p4 P/ y/ o/ |
    if A_induct=1 then clone 1 load to P_pick15 I, k9 w/ L! m# R# i
    else if A_induct=2 then clone 1 load to P_pick2
) |- P/ P6 Q$ A5 J        else clone 1 load to P_pick3- z  k, q) w, J' a; I0 y
end
6 D& d- C* M1 s9 x: r
2 s- q' e6 z# i% r5 Q% [! R0 Gbegin P_pick1 arriving
$ l/ b$ q4 u! Y5 X( C1 C1 Z1 f    set A_i to 14 F, l9 L! n# H
    move into Q_induct1
/ V) e+ w  ~9 p( N4 u+ N! X7 W    move into pickaisle.induct1
- D& Y/ G3 e2 j" b6 E! s4 s    while A_i<=30 do begin
: D! X* U& G! j. v( z; j& Y* W        travel to pickaisle.con(A_i)" i, C5 s! V' y( z0 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \+ `7 v7 T, `4 v8 X5 {" Q        else wait for 10 sec2 T" X3 r8 R: X1 E5 l  u) v) N; t
        if A_i=A_leave then send to die
6 N. {; U' h$ p4 K5 q/ q% E/ I        else inc A_i by 1
3 s, e9 C8 V) W    end1 h* d+ w4 a' h5 j
end* i  N; X/ d$ U( ^
* U, w- h! m0 T/ p4 n1 g% `/ f8 Q
begin P_pick2 arriving
- s4 |8 P- y0 o4 T( I    set A_i to 11
; f6 t# A( W. Q  e( V3 S% a    move into Q_induct26 S; ~# Y* R- f, B1 o
    move into pickaisle.induct2; \7 M7 r; s+ |" g
    while A_i<=30 do begin
; V8 D0 H: |/ x; {        travel to pickaisle.con(A_i)4 L' C  J. ^; j+ j2 [4 W1 E' @$ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& n1 R9 K7 x5 Q  P- V, l5 x7 W
        else wait for 10 sec5 e1 i* u( o) p' R; g2 o
        if A_i=A_leave then send to die
5 k+ _9 Z1 @% W9 Q" [6 r, B* N        else inc A_i by 1
, r# K2 L: N( x5 x- D* }    end
: j! N- r2 T* K9 O+ V7 Z) zend
" k7 K6 [' c/ r: m9 p: L. D/ ?5 `
begin P_pick3 arriving
+ D! n+ X, A* M4 ]8 z' M    set A_i to 21' H2 h9 d3 J, L- V
    move into Q_induct3; D5 Y& r1 \& p* z2 H& [
    move into pickaisle.induct3, Z6 `% b9 q- x& A, f6 u
    while A_i<=30 do begin. V; W6 \' W! T
        travel to pickaisle.con(A_i)
5 ~+ W- T+ @& Z( c1 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ C, x" p- E% o% x+ `0 q5 j' V6 T5 M$ c
        else wait for 10 sec) i2 s/ _) m0 N
        if A_i=A_leave then send to die
% _, ~, f* j* _4 @  H        else inc A_i by 1
3 v. ?: O- Z8 x- x+ ~; M    end) Q. @, d2 ~, a% n
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是个什么东东?
* a0 z0 m7 o( d0 dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! B2 _+ P+ j+ f9 R
) X1 L) k& J8 T4 H0 ?; LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& x- n5 E: u% |& X
9 a" E; e4 Z# U; v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; M4 C$ K8 B9 V6 P$ Z% v+ n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# S# H* D& Z3 L- |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% e& X; D) O  E$ P, S1 {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: o2 j3 ~+ s. t2 Z6 j* Q
begin P_induction arriving
* Y7 q: X* u$ U. G- J1 x9 ]9 t    clone 1 load to P_pick(A_induct)! K) X# j1 i/ c+ b" a3 u
end最大的系/ M7 y( S2 T4 b
3 J% K+ D$ V: C1 B; G: C6 P5 g
begin P_pick arriving
6 v; Z, Z4 o6 I8 _    set A_i to procindex * 10 + 16 G8 x6 z6 z& ]- K' z2 T* m
    move into Q_induct(procindex)- @6 h, z3 ?' x; ~: d3 M
    move into pickaisle.induct(procindex): V! _/ n3 L6 h, n
    /*check the type of pickaisle.induct(i), for your last problem.*/  [; e7 t' b3 W- N/ x
5 X0 f2 x! F# k: v* ~) L+ ^
    while A_i<=30 do begin) ^) T- Z' ~3 M
        travel to pickaisle.con(A_i)4 x8 x8 f8 D- T; }6 }! r, r3 }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 x  B* s8 t. p/ v1 r: D' W4 p2 G
        else wait for 10 sec6 C8 `" Q+ V  }6 J5 g3 P+ U
        if A_i=A_leave then send to die/ C& w- N7 y3 Z0 D( Y5 {
        else inc A_i by 16 h# \# A" ?4 I
    end
) S  U+ V# C0 E; }# ~' z! zend
2 G! ~* ^5 y" }) l5 G9 T
: m; I: H% g3 o$ P2 M4 L5 v其中的procindex为整形,代表当前process的序号。' r0 f" U6 ~; V* a9 g' P* q
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-7-12 16:11 , Processed in 0.014230 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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