设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11140|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s. D; E# A7 s
* G( J1 U) @9 X我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ?4 Z0 e3 }/ V' r. {- Z* ]- ~* `/ ~0 r$ Y1 T
begin P_read arriving
" t7 S8 J7 {4 @. ]4 _8 E4 J6 n    while 1=1 do begin# h  v6 n9 i# u# X. X) R
        read A_tote from "data.txt" with delimiter "\n"$ F; e. W  ?5 ~7 L
        read A_time from "data.txt" with delimiter "\n") u7 k9 w$ S. r8 [% O6 F4 J
        read A_leave from "data.txt" with delimiter "\n"$ m4 R4 ^- E" A0 n( n" y
        read A_picks from "data.txt" with delimiter "\n"
/ Z5 y' ]& ?! S1 \        set load type to A_tote
/ \5 G& S( E# N; K        if A_tote="tote 1" then set A_induct to 18 y) {. _9 g$ @
        else if A_tote="tote 2" then set A_induct to 2
! V5 E: W* u$ |, s2 D7 x; B            else set A_induct to 3   
) \3 i3 K3 ]7 K% E        set A_i to 0' y# ^- r! M! D/ q. |/ a
        clone 1 load to P_induction& ^4 r2 n! ]5 V, @) z7 p
        wait for A_time sec
0 `; v4 ]6 ]8 n6 o    end0 V  [" [- s- r1 C* |. R
end, P0 v8 [/ c" m" T) K; |  q) _

$ t/ w; t8 F/ U1 r0 [) Gbegin P_induction arriving$ n7 x6 x5 ^( |5 }9 E5 E
    if A_induct=1 then clone 1 load to P_pick1/ T4 h# F  K' i2 c/ T
    else if A_induct=2 then clone 1 load to P_pick2
" I* e" c$ F9 U0 E1 A* n        else clone 1 load to P_pick35 m% m  e# I% N% B  G+ ]
end
0 k; D. E8 x# W( M8 f7 O
4 ^* |; @/ F. }begin P_pick1 arriving( }- y' k1 t+ F& ^( y
    set A_i to 1, u+ Z1 ~, U. T. k- b( V- [
    move into Q_induct16 G- ?6 Q6 ]5 K; ?3 Q: _
    move into pickaisle.induct1
! B! d3 r9 _( e    while A_i<=30 do begin% F; A: q* |$ k) ~$ J% p: ~* K$ J
        travel to pickaisle.con(A_i)6 q5 b- y4 c7 `' J  S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 S0 X4 ]" Z) s! c' o9 x4 s4 i, N6 U        else wait for 10 sec
+ p! k  f- W" G9 b8 {        if A_i=A_leave then send to die5 R) D% R" I, R9 i! K* u$ b
        else inc A_i by 1
- T/ h" I7 a$ \- ^/ Q; u    end
2 G! V; Q4 X- m4 gend9 d: H/ `" S- H/ g+ T2 L

/ `2 l, ~$ I0 I, ^) Nbegin P_pick2 arriving5 v. q  J7 z4 g; u% B
    set A_i to 11
6 P% Z, g  T% e4 x9 Y8 _5 y    move into Q_induct2
: g# y" m8 c$ C$ x( U: l$ R: P- S1 E    move into pickaisle.induct28 T8 w6 L- z9 }. Y+ {
    while A_i<=30 do begin, R$ A9 n5 F: A/ n* g0 z5 K
        travel to pickaisle.con(A_i)
) N' v! V: @4 g( m2 b5 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" |4 s& s. g7 L
        else wait for 10 sec
( T! s7 n- y5 ^& X/ u# d9 ^        if A_i=A_leave then send to die
. h3 z! r1 X, v6 j. k: G: x        else inc A_i by 1% n' B! D) a- I; X
    end
! U" K7 a6 ~8 {. Oend7 x1 p" R, P  p& B, a+ n+ v

5 n% ~2 K3 x' c: t& hbegin P_pick3 arriving7 `; O/ N) b/ G, B1 X( J* n
    set A_i to 21% ]4 N: ?. L1 L. E
    move into Q_induct3! I7 B% Y# h9 x4 t' Q+ B; K3 d8 P7 G
    move into pickaisle.induct3
, N9 N3 x. H: @* J2 W$ Y    while A_i<=30 do begin
8 K. g, V" n  p* P8 R# m        travel to pickaisle.con(A_i). E; ]; N0 E+ H( {# G  F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 T2 q' h3 s4 M! R! A* B( }        else wait for 10 sec/ [0 E0 w& o9 a5 E9 t" G9 I
        if A_i=A_leave then send to die
% r' D( I" O: T, F2 f/ m; ^7 R2 F        else inc A_i by 1! Y4 G: L/ W" F  @. ^2 `, K
    end
; J" V) N6 n9 hend

最佳答案

查看完整内容

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是个什么东东?
* W% j: u( E6 Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 S& T. e, d' D! j/ X  }  b; k: D0 K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 {. H( T) r1 c. ~( @2 u9 o1 J, M
0 {) b0 {5 v" x# H5 r' f0 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 @% W( r$ }* U+ c& p; I; y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 G: _) Z1 X. W& W7 M9 L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) m4 ^7 `8 W2 o2 g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' O# N% ^4 I" Z
begin P_induction arriving
  i' v8 J2 ]: R' j# s* T# j! O3 `' v    clone 1 load to P_pick(A_induct): X6 h$ o$ @8 D3 R- q% q
end最大的系2 ~* `& \, W" K$ ~
' t8 @9 a4 z% ~: _4 j3 B5 {: z
begin P_pick arriving- R5 r+ E( Z8 i2 d  u* Q9 G
    set A_i to procindex * 10 + 1
* d6 b* f  F" @    move into Q_induct(procindex)
. Z) M( h" \! [5 Z/ T2 O# T    move into pickaisle.induct(procindex)
6 l) U4 R! U; v! {' n$ T    /*check the type of pickaisle.induct(i), for your last problem.*/# u1 v' C* e5 D2 u  F4 q9 j4 e
/ u2 R& j: d+ t" I/ I8 k
    while A_i<=30 do begin. L: z: R9 ^' B2 ~# X
        travel to pickaisle.con(A_i)" B6 n! C! f: P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _& G& [4 `" o6 c7 `, b& c
        else wait for 10 sec6 U" A3 Q9 }  z& N& s( ]$ \
        if A_i=A_leave then send to die
' c+ _  w0 A/ A2 x        else inc A_i by 1
# x: X* w+ K# s' r    end3 y/ ^4 f' M3 K- [! k" F+ T2 U
end# ?: K7 R0 D% a: E$ f9 _
) W8 X. i, t# _, ]) `) ?% q# v8 s
其中的procindex为整形,代表当前process的序号。
$ z! S& Z! G  c% p* y3 Ustation和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-10-25 21:39 , Processed in 0.016514 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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