设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13718|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( T2 d2 ]" _  z2 D' Z: F0 T) }1 w2 P& J3 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中的数值,不知道会不会有什么不妥。
& T5 |8 G2 ^  z; @& m9 d5 x' Q* \
begin P_read arriving
' N& C1 V8 m( P. D4 E    while 1=1 do begin
5 I; j/ r6 w9 [( Q% m3 `        read A_tote from "data.txt" with delimiter "\n"
4 e( E; p% L1 Y' p! z, t        read A_time from "data.txt" with delimiter "\n"+ D# X' u# c8 c3 M. Q3 _* X3 i
        read A_leave from "data.txt" with delimiter "\n"
/ N$ y' @. r8 D! B% }! y+ g        read A_picks from "data.txt" with delimiter "\n"
7 G( B! @# |# F( [9 \        set load type to A_tote& _8 J# {5 W- ^7 |0 `' _+ a/ k
        if A_tote="tote 1" then set A_induct to 1* Z7 _& d* v" Y
        else if A_tote="tote 2" then set A_induct to 2
8 {; w9 ^3 u3 i) I% Z            else set A_induct to 3    % n3 _+ o  M% D4 Q+ A  x
        set A_i to 0- Q" s/ x. |$ x. s# r  q! C
        clone 1 load to P_induction
8 J' X5 G3 X1 w( `: U8 N        wait for A_time sec3 F& V% b* M7 ?, x* q
    end
$ ^$ ~! B& }9 ], B/ @) o, W& Q  Iend6 G: U. c& W8 G. t
: B0 X# P0 n" p3 K) e$ Y
begin P_induction arriving0 ]2 s2 }' z8 v- M* ?8 Y
    if A_induct=1 then clone 1 load to P_pick1- o/ ]6 P8 ~' m: A/ M% a2 e
    else if A_induct=2 then clone 1 load to P_pick2
9 N! }0 j( Y/ x  m& U        else clone 1 load to P_pick33 ^# E5 W& H& x3 E1 |- g3 J
end" H) W* ?+ x1 p" T7 w3 ^

: R% ]; m& L) g+ G7 ubegin P_pick1 arriving& F+ D' R/ P+ O! D5 |: B! M6 @0 l
    set A_i to 1) t4 @5 [) |  B6 J5 b% [) ?9 l
    move into Q_induct1
$ v, q* I6 ^8 d7 ^" m    move into pickaisle.induct1
. ?  l6 x& Q! B/ q$ B7 i) H    while A_i<=30 do begin
9 g. v9 G& R/ F        travel to pickaisle.con(A_i)9 z5 m0 R& E8 U! d1 b; @& s- _0 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  A5 R5 G+ J7 j! g/ X$ N        else wait for 10 sec# h5 G$ e) `4 e! ~, V6 y# f
        if A_i=A_leave then send to die
/ ^: i, W' R5 ?2 o5 Z  ~# \0 X        else inc A_i by 11 K. b) H- D0 X0 H9 {4 j) @. \
    end
+ c* H! T& ?. i3 qend
. ^3 C! `1 L& y% D" ^% w% C- ], [' Y4 E/ S! G" @! `6 L& T# I
begin P_pick2 arriving7 o4 |5 Z4 z+ f
    set A_i to 11
6 J* H, k2 p* k% x/ K    move into Q_induct21 o; K  g" y/ c/ Z6 `$ c* A# N
    move into pickaisle.induct2: }* {0 G$ q! e% ]
    while A_i<=30 do begin( r0 M- X9 @" C3 Q0 k4 z
        travel to pickaisle.con(A_i)
; q- G9 N# E% ^7 C: @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 O* U# w: i2 S0 r: r
        else wait for 10 sec
/ Y" r9 f* g* N0 s* U. R$ F        if A_i=A_leave then send to die
8 c% j/ S+ |+ H, I/ e9 i        else inc A_i by 1
( J- Q2 b! H  T( g  v7 v    end
4 ]3 E2 G3 \' P  q/ tend
! N5 v2 u7 ?. @$ N" s5 n( j0 }0 ]% W
begin P_pick3 arriving
: ~+ H* h- N9 t3 w    set A_i to 21
3 R" J: m! ?, M4 v' y    move into Q_induct3/ U. Q7 c& j2 w' E
    move into pickaisle.induct30 z. M  Z' v% {, D. ^
    while A_i<=30 do begin- [2 ^& K$ Z8 J# O
        travel to pickaisle.con(A_i)! L3 e( v: u  C% Q7 \: x9 }& h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 g' x6 O8 b9 [$ J$ L        else wait for 10 sec$ q) ~; t, \* m4 o: y1 W
        if A_i=A_leave then send to die
  e/ A1 M$ R) _) y        else inc A_i by 11 s, k, a, A6 O% Z# ?$ G
    end
- q& B6 W3 w, S$ x6 aend

最佳答案

查看完整内容

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是个什么东东?
# y0 s1 \; F0 o  B; k' Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 K3 p% I( J) e, h2 C  [4 l+ |4 |* D/ U6 ?! g1 }0 m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- Y- z8 c* v' m4 k+ |5 J0 G, K. V' U* X+ ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# Z+ y, T5 [7 u% ^' c4 ]  ?0 L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; C0 O# C/ _0 j- x: G+ _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 L: C  R9 B, R; a- A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 l3 z# b0 F+ {8 D
begin P_induction arriving
" A8 G* y' x" y' ~1 J# U5 x    clone 1 load to P_pick(A_induct)1 N! h. ~% p+ j2 f8 i
end最大的系
  e* ?2 B' d. ~) o/ t- o: r
' M5 G5 _" z# x+ Y: g, cbegin P_pick arriving; d4 m7 e5 i; A! o; p  ]
    set A_i to procindex * 10 + 1  c7 R5 B7 f  b+ E6 m  ~# \
    move into Q_induct(procindex)
$ ]6 c4 h9 C3 t    move into pickaisle.induct(procindex)
. a0 \9 j  ?  _) T4 U6 q$ ~    /*check the type of pickaisle.induct(i), for your last problem.*/
& Y& j$ X2 U9 J2 K
7 b& V$ j0 a7 r    while A_i<=30 do begin
' ?+ X7 y) b  A5 f, ?        travel to pickaisle.con(A_i)
* B2 V4 Y3 ?. g. b8 z7 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- z; b: N2 W2 X$ @5 p        else wait for 10 sec0 C# s8 a1 P2 ~4 U- k* m
        if A_i=A_leave then send to die
$ a& e( i3 ]' }  k" m) c        else inc A_i by 1$ K/ @: W0 k% P, h+ G
    end
) }3 W+ M# u6 ^' [/ J/ Aend0 t- H. k' r$ E9 P: h

! w) s( p1 P% G其中的procindex为整形,代表当前process的序号。
, c* d- M6 U- W/ z' 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-4-30 16:22 , Processed in 0.015476 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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