设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14180|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 g& _3 `" J7 j1 g! v1 @5 U/ X" @" w4 V% e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 W& Q3 r7 H6 ^7 w
+ B/ S+ [* V1 L
begin P_read arriving
4 o' l4 n* {4 u2 Z; R    while 1=1 do begin& U% }; N( w! ~
        read A_tote from "data.txt" with delimiter "\n"4 V+ L7 C- p: ]# G" O. Z! V9 v
        read A_time from "data.txt" with delimiter "\n"' O9 W, `# v' v3 U- ^! J" M
        read A_leave from "data.txt" with delimiter "\n"
) K7 c7 R6 n5 I6 e; P1 k3 d+ j* P        read A_picks from "data.txt" with delimiter "\n"" ~  W( p7 k" x# [$ h( C
        set load type to A_tote
( M" p' ~2 m- J4 L! Q+ c        if A_tote="tote 1" then set A_induct to 1
  |7 n; ~# ]7 J        else if A_tote="tote 2" then set A_induct to 2; J* P0 a6 z" n6 V+ E, z
            else set A_induct to 3    8 F, p# e/ ]' e. n# E' r3 U4 ?
        set A_i to 0
/ u. L0 |) }# T7 |0 ~+ B1 b        clone 1 load to P_induction
) k6 X- M. W$ l        wait for A_time sec
  ]- J$ H# l- W& G  M, M9 T    end+ S: R7 f3 O1 ]
end
. M, C5 |) P' V7 k# {6 ]- S6 d' f: h. g/ C2 E
begin P_induction arriving1 U' d7 z. S, X/ O, G
    if A_induct=1 then clone 1 load to P_pick18 b8 X7 r7 [6 O* Z3 A
    else if A_induct=2 then clone 1 load to P_pick2
4 H( t) ]  T, r" }+ o1 C/ v        else clone 1 load to P_pick3
7 \1 Y  ^0 p2 {) {end
# |/ D* _% r$ p$ p8 P6 P
8 B+ t6 s& z; [( g- Qbegin P_pick1 arriving
/ _) G( S/ l, i, |9 e, d& ]/ l    set A_i to 12 k( r) [0 x* o: A
    move into Q_induct18 y3 D9 b& X9 T$ w4 N
    move into pickaisle.induct1& l4 r) g! o" [
    while A_i<=30 do begin
0 a% G2 Q* }) a$ J- }        travel to pickaisle.con(A_i)3 C1 s" g2 x) A1 `+ \$ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) H/ m5 w( t: T2 _* |" @
        else wait for 10 sec
- ^, L, t! \7 r2 h+ e2 v% A: J        if A_i=A_leave then send to die
, P2 m7 r, p. n, E! w% d1 h5 e        else inc A_i by 1
# Y& h9 t4 }% W; `, i. N( j    end
0 D3 t; }, c0 ^5 \( oend6 {. s: d% v9 ^
- D% c0 k4 l7 p" z  e$ h' I
begin P_pick2 arriving0 n$ a; C, E" {4 B# e, _
    set A_i to 11
  U) K; ^, }  U( e/ b    move into Q_induct2  y; R! y* Q; O# H2 Z
    move into pickaisle.induct2; `% I+ B$ r9 m
    while A_i<=30 do begin
7 c; R1 B( B/ D- D9 I( b6 N; a        travel to pickaisle.con(A_i)' v* r5 `& \3 D2 ], F2 Y4 F, f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]0 }0 e, b. f        else wait for 10 sec1 I8 K: L4 G1 Y! c) p
        if A_i=A_leave then send to die# G) s+ |7 L$ L2 M3 v; J7 O: `' H
        else inc A_i by 1
2 g7 r' f5 M5 N8 n/ _2 `( }    end
8 _. r+ Y9 z. \2 T- P$ g+ Kend# B3 z& R! ]; I& b0 }

# ^- S# g3 i$ Wbegin P_pick3 arriving
2 H7 K4 W9 ?8 }" _% D7 V# f) u7 o    set A_i to 214 j2 w5 ]* |& j9 c9 M8 [$ V& t
    move into Q_induct3. e2 E; T. c0 d  V6 l/ E
    move into pickaisle.induct37 \' ^6 w- F" h- Z. |8 E
    while A_i<=30 do begin' ^; W( c; [* I3 B6 t6 _9 f; D
        travel to pickaisle.con(A_i)9 }" E" ]6 N) r: ?+ J/ w) a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ T% _3 W: S( v' z! A6 x3 M        else wait for 10 sec$ t; Y% y6 d3 ~( n4 n: |
        if A_i=A_leave then send to die
9 S. [9 E( e% ^/ ?8 z) g) ^        else inc A_i by 1" E% \& H/ o( A6 j( r  L+ f  O
    end) d: b5 a) L$ E2 \/ i! I$ f
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是个什么东东?
, q5 s) M9 b' f8 A0 ^! Q: v7 amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, j; i' n& V5 O: q

" n% ^3 p, H! p+ H- ~+ G) p& \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& i- p% q: B* U1 c; \# |  x9 A

  p& A6 O, p; r6 m0 U0 |6 H& D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. k7 H( \3 l0 g9 C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, C% k0 a, S* `7 Y" x* F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" J  e1 x2 [4 o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 C' F0 ?8 W% E0 U/ }! z8 Xbegin P_induction arriving
7 z5 Q# L* z- ?$ J    clone 1 load to P_pick(A_induct)
& [$ X( h( @! ~1 Lend最大的系
+ _. x3 r4 ~; h! S- @' k
8 S; \, Y: j& |+ Y2 _begin P_pick arriving
: l: S) k+ S% R; I7 x' H; [    set A_i to procindex * 10 + 10 R8 ^7 A, I) |
    move into Q_induct(procindex)1 x. i9 ~7 {# o- P# _
    move into pickaisle.induct(procindex)7 m% E/ T  J. W
    /*check the type of pickaisle.induct(i), for your last problem.*/
' r$ b, W4 I9 L, o$ f' R* T3 w" j" J3 l
    while A_i<=30 do begin! q/ m+ u- w' s, }
        travel to pickaisle.con(A_i)
) i9 X! O6 n' y) c' c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 B/ _( ?5 D4 ?, q9 [. ?
        else wait for 10 sec+ W( t0 B. e  ^" Q) P
        if A_i=A_leave then send to die
( i$ B" t% [" J5 r8 |        else inc A_i by 1/ G  n( P" l: _2 Z
    end5 h& b7 K2 h, E' q
end
% r; J) G! [* ?# S) O. |
4 z: Q) ]+ Z0 M其中的procindex为整形,代表当前process的序号。
( y: k# s! |2 ]8 Astation和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-6-17 21:29 , Processed in 0.013551 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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