设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13914|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; F- C9 G5 |# m( k6 R6 b

" q3 Y$ c. F' G) I% k% 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中的数值,不知道会不会有什么不妥。. C: j& h  r% |( Z$ U

4 k* {; d1 L5 J% m( {: |begin P_read arriving0 ~- X* F- w& G3 Q: g  w( O) M2 G) ^
    while 1=1 do begin
! g  ], n9 m6 k  A        read A_tote from "data.txt" with delimiter "\n"1 T% O6 l& J5 Y. B
        read A_time from "data.txt" with delimiter "\n"
3 E8 f; X  \; j: z7 p2 D        read A_leave from "data.txt" with delimiter "\n"
5 {  c& b: L* z. y; D        read A_picks from "data.txt" with delimiter "\n"
2 }' j2 r$ ], W- d        set load type to A_tote
3 I  \: S8 X& C: N        if A_tote="tote 1" then set A_induct to 1
" f/ O8 q0 n1 o. T  t        else if A_tote="tote 2" then set A_induct to 26 X. B9 i2 l9 U0 q3 l: g
            else set A_induct to 3    ) A! L* z4 t' [: z: w$ O
        set A_i to 0
' e; o3 q! o8 Y& H        clone 1 load to P_induction! j6 w" U6 j1 {: }5 y
        wait for A_time sec
8 L% A  M5 E; Q# Y% G" y. Q    end
: {  {, j& @( P: Hend
( p! f8 q  {0 x9 ?6 U( K
) v; A$ |9 m' h  s6 _. G; obegin P_induction arriving
  G* _5 S: y! g8 D5 I    if A_induct=1 then clone 1 load to P_pick13 @! s0 j7 [7 s- _7 L8 @) `. x* o
    else if A_induct=2 then clone 1 load to P_pick2. E  \* v! n  }9 a
        else clone 1 load to P_pick3  d0 e9 g- y  ]1 Q& Z
end
) Z/ y( n. ~% l+ |4 b" L) O6 ~$ H
begin P_pick1 arriving; g' c& a; U2 ?
    set A_i to 15 @8 O# p/ e$ _9 a' d
    move into Q_induct1
9 \! W& N, B7 s$ f5 c    move into pickaisle.induct18 C4 n9 ?( g4 W! v
    while A_i<=30 do begin7 n0 e" |6 S" p7 N
        travel to pickaisle.con(A_i)6 G: k* i$ u- N* x8 k/ \7 S) L7 Z7 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. ]+ ~* f: w5 m/ N7 g1 I
        else wait for 10 sec- \4 r% P- F7 o) Z7 J: E
        if A_i=A_leave then send to die
9 W2 F# C) M+ o9 ]        else inc A_i by 1& F' P2 b% M" I/ B+ \
    end
4 K5 g& ~' D% R* x6 ?+ Tend, z4 s) s) W& _( {) w0 X
1 M" L5 S; X* H8 @
begin P_pick2 arriving, O8 D/ M1 n- c
    set A_i to 11$ B& C" v. }( C+ _  g
    move into Q_induct2) W3 D+ J. b+ M! l4 K2 Q  t
    move into pickaisle.induct2
2 u1 m7 ?/ R2 L$ Z% D    while A_i<=30 do begin# x! s! b! n$ z+ d; I
        travel to pickaisle.con(A_i)
+ O4 w: Z+ H  P+ M8 u) }  q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- u9 M! r8 W% z6 R9 o
        else wait for 10 sec# z& g: J  d3 z$ T8 u% f' O
        if A_i=A_leave then send to die
- L/ m' t! }5 I$ J5 {  C        else inc A_i by 10 b; A+ I0 v+ E6 e6 ^# R6 |
    end. U% U4 B5 t+ H$ u
end, ?, v  o* o1 C5 C. I
2 d* Z3 I2 h& c( h) h; d& \
begin P_pick3 arriving
4 M+ h" q+ _( O% ~8 Q6 g    set A_i to 21# n6 K; k2 s: ?! |2 A5 m2 S
    move into Q_induct3& u  b3 y- d3 U0 Z2 W6 k8 D( K* t3 F( C
    move into pickaisle.induct3( c- O. j+ L9 ~* K
    while A_i<=30 do begin. m) _/ e# n4 G/ W0 K- X) O: p# [
        travel to pickaisle.con(A_i)) W& w# |, A, j) ?) Z7 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ k; F5 L) [" i9 M        else wait for 10 sec
, b! J+ A, d7 G$ a) N        if A_i=A_leave then send to die
1 D5 ?' o$ {  H6 J2 L        else inc A_i by 1
# Y1 p; |0 y. X1 P    end
  B. Z% ^: `& s& r% {% y9 E* `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是个什么东东?* B! R+ z- G$ P2 ~& o* {* x/ q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% T9 s* \3 d. |- S7 G- ~0 ^* N7 ~$ o9 R% H7 X2 w/ F, i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 k" @$ G7 a: F. M
; B/ H% J! l+ \! s" f0 ]0 ^8 ?6 E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* y1 a: G1 v1 C4 o$ |) {( H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# K3 w% ?& Z' b3 P: y4 w- |9 Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& t3 S$ X) {- d: z! C
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ [. O- [' Q/ ]" n8 qbegin P_induction arriving4 A- y7 D+ ]) {! {# O8 j% U
    clone 1 load to P_pick(A_induct)
, W  P+ G" b3 @9 g- Dend最大的系
! Y$ s# y& p( z" D2 a
4 x  w, A8 |& L+ q2 b% Z) f# Obegin P_pick arriving
2 }, P8 O  o" `    set A_i to procindex * 10 + 1
  D' ?8 I7 L, V. z( k% n; x) ~    move into Q_induct(procindex)
/ v0 F, f7 |7 `2 h) I    move into pickaisle.induct(procindex)
0 F  u) Y& T1 G5 n8 Y; d    /*check the type of pickaisle.induct(i), for your last problem.*/# r% }/ ~, K) `9 n& X) y! B& h
0 N9 c( |9 G3 O# ~
    while A_i<=30 do begin
; b7 I9 b3 e+ Q2 ]7 x* _2 C7 p        travel to pickaisle.con(A_i)) k  ^, \0 ]; f7 @, V" m. o4 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( b5 T7 Z4 p+ t" U; e' @; \
        else wait for 10 sec
3 u8 U7 x7 B) Y" H, R        if A_i=A_leave then send to die
  V2 b: B" D- P        else inc A_i by 17 F. l( b  y) x. g& d9 T. \
    end' i+ ^4 Q% P) }
end
; ~/ d! l' H$ Y6 B0 t, @! T/ C, R# a
其中的procindex为整形,代表当前process的序号。
# P% l4 K1 g8 t2 J. Sstation和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-5-18 12:03 , Processed in 0.022681 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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