设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12478|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 Q$ g) k5 Q9 s4 F4 Z# X+ U* ]3 |; 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( L/ X) m
" Q# G7 Y. r/ k9 [begin P_read arriving3 w, a, I7 L4 I3 W8 N
    while 1=1 do begin
/ o% `  d2 g* ?" q        read A_tote from "data.txt" with delimiter "\n"
  [8 G/ d0 E7 \/ b3 C3 @+ s        read A_time from "data.txt" with delimiter "\n"+ x+ T: ?0 T2 r# u+ C$ S! X; Q
        read A_leave from "data.txt" with delimiter "\n": a: q5 R7 |! G% c/ B5 Q# x: |* b
        read A_picks from "data.txt" with delimiter "\n"+ }* A$ q* {( j0 D1 }: u
        set load type to A_tote
& Y/ S; O2 `7 |9 t. e        if A_tote="tote 1" then set A_induct to 10 F; T4 y7 j% }* v, ?
        else if A_tote="tote 2" then set A_induct to 2
+ z, u1 D# O7 c            else set A_induct to 3   
. X4 |& ]: I  j, T# G& @        set A_i to 0+ ]1 G9 J2 D/ ^+ |  e
        clone 1 load to P_induction" Y2 h4 m4 d# C$ P
        wait for A_time sec; E& Y% P" ^6 n3 Q1 z) z0 r
    end# H$ [7 o  o3 ^: L/ W" t
end1 g( {/ X) O, k; Z# z) ~# \6 h
4 ?) }2 ]' f" A' m0 E1 D1 _( R
begin P_induction arriving& F% H) g4 i( D+ r1 ]  _6 c# m, T
    if A_induct=1 then clone 1 load to P_pick1& a6 M) ^6 o% T6 W0 v! i2 c4 m; x
    else if A_induct=2 then clone 1 load to P_pick21 Q: `3 |5 P" m7 ]* I2 T0 Y
        else clone 1 load to P_pick37 e. T; W' y" A1 i
end
' }; `) _+ O6 m& d$ C. k: J* a1 U+ B2 s! }) M
begin P_pick1 arriving
. P! D) ^/ M/ X    set A_i to 1
! Q- m5 m& v$ q3 j+ x    move into Q_induct1
2 ?3 F0 d  ^" F. w8 r+ K" M' t    move into pickaisle.induct1
  d" x2 p! G& v* _5 P    while A_i<=30 do begin5 |1 L3 ^8 Y" p( i/ E$ i
        travel to pickaisle.con(A_i)
+ M( i: I+ r; s; {8 L5 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  I% N4 p) U/ {+ C% @* V: o& T2 X        else wait for 10 sec
( Y/ U0 F  q6 f" a        if A_i=A_leave then send to die1 C- ?4 g6 m6 a0 J0 v/ ^+ i8 G
        else inc A_i by 1
0 @! b' D& G$ E; E* X( H: ]    end# S2 l4 }* V3 Q6 Y* I; k0 M5 ~) N
end# C1 n. q" ?9 Q% W# m) I

# u  \5 ^" N8 p- W' c6 O5 h. Wbegin P_pick2 arriving1 {  v; v% ]2 \6 e; B6 a3 a; v$ F( }
    set A_i to 11
, N! p  x" H. q0 o$ O( D9 X" N) y    move into Q_induct2
+ L  H8 H0 r3 [1 A  I    move into pickaisle.induct23 d1 A. m" x6 j9 ?+ D$ W; ]/ G. C
    while A_i<=30 do begin8 H/ e1 Q2 J, t/ \; M7 F% S
        travel to pickaisle.con(A_i)
9 h8 w  b4 m1 z1 i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% g9 @! l1 p7 m3 ~7 @        else wait for 10 sec4 x$ w$ o: F! i
        if A_i=A_leave then send to die
& P8 ^* |2 o- B" n8 N# K# C        else inc A_i by 1
& k) Y  ~1 J$ I' v3 `    end
" d: \3 B& u! o7 T4 Hend
# b* d7 J- D( j  v0 H) s1 O8 {2 n: J/ S  ]
begin P_pick3 arriving6 S/ ]7 D1 m: S% i) d* n
    set A_i to 21& Q1 I- V! z- e6 b7 @* t
    move into Q_induct39 @, _; L; C: S& H$ H
    move into pickaisle.induct3% m# H& m- V% {
    while A_i<=30 do begin# m+ J; E2 @' k+ t! t
        travel to pickaisle.con(A_i)
! Z% g3 q% Z" g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 N' T# ]! ^! ^, P9 H5 b6 i1 J
        else wait for 10 sec1 F5 j4 v$ Z  `1 \5 n
        if A_i=A_leave then send to die
- `5 S2 Z  t3 q+ J$ z        else inc A_i by 19 n0 [; m- ?) j, a" Y
    end6 l5 c3 x5 u& V9 t' K- S
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是个什么东东?2 t6 }$ n+ \) T% a" `: O  c/ U
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" G4 B/ E4 B6 r' A
7 Z. m3 Z  S/ L" X+ A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 s+ @" f1 T3 t; D  a3 U
1 i, W5 D3 [1 a- |4 H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 w: a# F7 `+ C) g1 W8 }9 x' U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 M. f0 ]1 q9 I: n1 K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' X8 V2 n& |2 F. s5 v" b! u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 L' L/ x. a& m/ z1 Ibegin P_induction arriving& |& @3 ?6 ~  a, Q
    clone 1 load to P_pick(A_induct)
/ D0 [: ]; Z" o7 c8 o# E- Kend最大的系6 |3 J- J) u: `( ~9 A- e
, P: c- a  c& }# T
begin P_pick arriving
1 v5 o9 l3 _# `7 i2 h    set A_i to procindex * 10 + 13 b( I' F# q! Q* j# J
    move into Q_induct(procindex)
8 n8 e% _0 P* A4 ~, s% l! j    move into pickaisle.induct(procindex)& M+ B& N7 V( E6 v9 `$ X
    /*check the type of pickaisle.induct(i), for your last problem.*/! `1 ~9 x8 E9 p4 ]' C" C- }

* A7 ~9 ~! C* F# m7 j    while A_i<=30 do begin: \' E) r* m. j) h% ], [
        travel to pickaisle.con(A_i)
( h- `7 M, _8 D0 U4 b& W6 Q; j/ L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 t1 h1 \3 ]9 r6 K& H* Z# g; f6 t        else wait for 10 sec
' W3 ^* B" ?; }& m3 ~- F  g        if A_i=A_leave then send to die4 X8 }& b9 W, I! O% v  R8 c
        else inc A_i by 1* w! N4 T( n1 h6 E8 t5 A9 E8 S
    end
3 c. f7 _9 @* s& pend# n% h* ]2 G$ m* u

  v7 D8 e! R0 L其中的procindex为整形,代表当前process的序号。4 R% Q8 O2 j- ^9 }6 o+ a( m
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, 2026-1-27 13:19 , Processed in 0.017142 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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