设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14443|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- x& Y" W5 ?( D8 j' c8 b+ o5 f

: _1 o) T9 Y( g" q5 B我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ X# ^1 ~- Y$ l) T  n3 I& e  n7 W- Y- I; D, J, ?9 d
begin P_read arriving3 S6 t) m) j1 @& ?
    while 1=1 do begin$ N; }* U  E( }, f
        read A_tote from "data.txt" with delimiter "\n"" |6 g: H8 d( c, I1 Z+ E
        read A_time from "data.txt" with delimiter "\n"6 X; I( o$ g) o# Y8 Y
        read A_leave from "data.txt" with delimiter "\n"( S" J( U, k* w  w
        read A_picks from "data.txt" with delimiter "\n"
3 O; i: A5 Y+ x- P/ }        set load type to A_tote$ V/ n. [/ f. Q6 @, P% B
        if A_tote="tote 1" then set A_induct to 1
$ A1 _8 Y2 K! s" V! E        else if A_tote="tote 2" then set A_induct to 2
' J+ Z% ], h3 e" X4 K5 u            else set A_induct to 3   
/ v. i6 M. K, O+ X( w$ m        set A_i to 0
6 n/ R! A) |  W% N/ a2 H. x        clone 1 load to P_induction
4 [& I8 r: u- z  K0 T1 ~: b$ I        wait for A_time sec
& s* p' }$ _& D3 G, n4 P( d    end" G3 G" Y. V6 |& s# H) R2 g6 h
end# P$ J, Y, ~2 Y/ \

2 U% G8 X/ L; G5 E4 Obegin P_induction arriving
# V5 H& i& L2 @+ \: _; V" z* L, D4 ~    if A_induct=1 then clone 1 load to P_pick1# z6 s2 L! ]5 l2 C& h1 H4 `
    else if A_induct=2 then clone 1 load to P_pick2; {0 N0 {2 d# E3 F) ^
        else clone 1 load to P_pick3
$ E. [8 k1 K: _4 c  O. Iend' I7 i- H$ ?' o9 S/ p

6 D& i" S' H7 C7 z: Q% o3 n* fbegin P_pick1 arriving0 s/ t1 C6 G) e* T8 t4 I
    set A_i to 1
2 ?+ e! @6 V7 j6 F$ u    move into Q_induct1
9 Z& x4 w/ S! h5 K3 V2 C  W1 U    move into pickaisle.induct1
: W; k; s0 B$ N( j9 W    while A_i<=30 do begin. ?6 [( T; P1 D2 T1 c) `6 A4 K
        travel to pickaisle.con(A_i)5 U- n6 i6 {9 t! x: H: `3 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* w7 J4 C8 }& f; ^0 s        else wait for 10 sec7 d0 x# L! Y; m
        if A_i=A_leave then send to die
! G; Q  {/ T: S, H7 R" ?. E0 B        else inc A_i by 1
, R. I2 \' O$ P( Q; ^2 T2 S- {    end! \  W4 B: D. s& L
end
$ L% Q% v1 Y. Y( h  [6 C3 U0 m% H. e( I8 G0 E
begin P_pick2 arriving
4 r1 H/ n" \- s6 ^( t1 j! b    set A_i to 11
+ U  N! @# g! M/ Y7 b# R    move into Q_induct2
9 N/ p6 b* g. Y* \/ p  C    move into pickaisle.induct2
. W% J7 P( [+ U# a    while A_i<=30 do begin
4 k7 _" V* s  ?+ {        travel to pickaisle.con(A_i)7 n9 v" }  V6 C9 T; p, {+ U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; {! P, f+ {/ e6 N! h
        else wait for 10 sec
+ V1 L) O4 c4 E& g; ?: l3 ]9 Y2 K        if A_i=A_leave then send to die2 \0 t$ Q& Q% T7 d2 i- y6 o
        else inc A_i by 1
7 E' J0 A* }+ d1 H9 R    end! o  s# v, R$ r
end
) |! s7 l2 W' i  V- X, O
  l$ @) G7 ]' j8 @& M! Hbegin P_pick3 arriving. h0 j& b: T" E5 p0 l
    set A_i to 21
6 j: D2 f. T+ U0 F6 O0 `    move into Q_induct3
; \8 `( n( I6 l) Q    move into pickaisle.induct3
0 a; e3 ^8 s0 o  p    while A_i<=30 do begin
# f7 O+ x3 ~! x, a. N2 N# G        travel to pickaisle.con(A_i)! c( ?3 A0 [# i/ M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; Y' s3 \' s) A5 E9 J0 z' Y        else wait for 10 sec
  c" B# M# v: h" J5 w        if A_i=A_leave then send to die5 C0 C% R7 B; p3 ~' Y
        else inc A_i by 15 j, N5 a+ }% m1 v( n) P
    end4 @' F' \- e5 w+ L9 u
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是个什么东东?
! @; l* I! x, |! |3 H' bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 G& `" R6 v% B9 D# {$ o8 p, G4 ]
! B* y1 I3 w# t/ _+ ?& O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' U- y$ l3 W! B* U* [

: J# P" K0 Q8 j% Y% C/ r9 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 r2 ^/ ~  J% r5 o) A# J# j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% W# P1 k' _- h& ]% P! X: ~, X2 \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, T% X* ^$ Y& }" h0 M& n4 S
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 E( c# i4 E7 v. U% R6 r
begin P_induction arriving
: u3 A6 _; o- y2 w! V    clone 1 load to P_pick(A_induct)
; ]( u& w0 B8 D$ {' Pend最大的系( D' M2 B. e  b3 S. i1 Z
# B3 E( ?) k; h
begin P_pick arriving% d; m; ]# x; N- E* l" M3 w$ b
    set A_i to procindex * 10 + 13 t( T! i# r$ q! ]% p( v3 W
    move into Q_induct(procindex), h; m. Q2 C. }8 ]5 o0 i
    move into pickaisle.induct(procindex)
$ W, e; W0 f- {3 c: @    /*check the type of pickaisle.induct(i), for your last problem.*/2 m! K! X5 u. c" m
  `5 ~% B) \( Q- N& L8 ^% w
    while A_i<=30 do begin
7 q# z' x4 {" \5 y2 f2 q/ D        travel to pickaisle.con(A_i)0 _7 |" D: ~6 t/ R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& L0 W" C4 t$ B; n        else wait for 10 sec
3 M* o& H& k# |' Y' ]        if A_i=A_leave then send to die5 u% l* n1 Q+ T$ N2 s7 o( C
        else inc A_i by 1
+ H1 H$ X2 c$ _    end
9 G2 y- C4 j( Z* ]0 w) i% mend, \; F* `! s" u

6 f% C8 e! G2 m6 `9 \( E其中的procindex为整形,代表当前process的序号。
$ O8 _& W! |" q- \! O: Ostation和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-7-11 18:25 , Processed in 0.017781 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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