设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14871|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# m* X3 D% Q/ ~6 S
3 g+ h* X+ E4 J0 ~! s2 l$ S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 d* \, o% S$ h' J/ h0 k
+ Y3 ~9 _. c/ o( I( }; j- x; lbegin P_read arriving) _5 Q6 I/ L1 Y. A
    while 1=1 do begin
" r1 o) g" i3 b6 f" y        read A_tote from "data.txt" with delimiter "\n"8 C* |; w$ B' {+ i7 b
        read A_time from "data.txt" with delimiter "\n"
4 u% q$ M- V, r! A0 p1 g" c2 s        read A_leave from "data.txt" with delimiter "\n"5 Z; ^, p( d$ _' E  y. Z: B6 G1 O
        read A_picks from "data.txt" with delimiter "\n"
( u# K: v+ }2 y* T! x        set load type to A_tote' w$ e; x5 i. z; C6 E: m
        if A_tote="tote 1" then set A_induct to 1
* ~" s- y; F; \2 S9 k4 b( t        else if A_tote="tote 2" then set A_induct to 2, i% n6 N; w( `" N  ?
            else set A_induct to 3   
* X& i# _9 a% y$ G4 {( W- a        set A_i to 01 q3 ^, c* h2 c
        clone 1 load to P_induction* L# N+ w6 \' L3 |% M
        wait for A_time sec6 Q+ k  e2 E- f
    end; X3 }5 f/ p! m  M0 I6 d: d
end
6 L/ R4 ^1 b; j. |' T; W1 K( A$ E. H+ ?: |/ W
begin P_induction arriving
* \2 S% l' {' {3 }. \    if A_induct=1 then clone 1 load to P_pick1
( L9 |+ ?! S2 H# _- T- k    else if A_induct=2 then clone 1 load to P_pick2
% ~. Q! p- V& ^8 ?$ u# Y; r4 H        else clone 1 load to P_pick3+ g4 c* O) K  T: P" Y0 x! ~. n
end
" w# t8 m$ m$ y( b( y( T- ~' J. n  `, X' a- b2 b8 n
begin P_pick1 arriving
7 {  j" x9 d2 r( n* u    set A_i to 1
/ v; R: o: V  Y/ d    move into Q_induct1
" E% o4 i4 I( \# h- P* }. r    move into pickaisle.induct1# l  j$ u' R' p+ H- b1 z
    while A_i<=30 do begin
8 S- Q  E1 Y6 m1 N5 P: w        travel to pickaisle.con(A_i)
# j) z0 u+ S5 h% C* q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 i) K6 _. m5 {; A8 S        else wait for 10 sec
+ A3 V1 L/ a; G1 e/ z" h8 F        if A_i=A_leave then send to die( E, F  G/ B' A+ X
        else inc A_i by 1
  b6 {2 F1 q$ P) I    end& T4 |; _4 M, x
end
2 F+ B- e$ K' ^% ~2 P% U: O& m9 y8 Q5 O$ C
begin P_pick2 arriving
" g1 g5 L& ^% e    set A_i to 11! u1 f! U: R; B5 z1 ?4 V% \
    move into Q_induct2; m/ j" S+ d" s6 U2 k
    move into pickaisle.induct21 j3 Z4 P. b" W7 s$ i' ?% d' g
    while A_i<=30 do begin3 T# Q& P" F# g! o
        travel to pickaisle.con(A_i)+ L4 Z& c+ j8 ?" l6 D. o; r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; K) ~5 R# {" _1 _% o; E1 u        else wait for 10 sec) M  F" M: S7 y/ y) X' q
        if A_i=A_leave then send to die2 q; i( i5 Q* x- D* l/ ]. d4 h0 s
        else inc A_i by 15 U  B- V, }( H) ?
    end: J- T* ?  F' R; j& |
end
$ U; g1 L$ ]" `" x9 o4 |" c$ p. n8 D% ~6 L, ^' T, H- R; V4 G% _- Q
begin P_pick3 arriving, d5 @. V9 O3 w8 e! F2 D0 G5 c
    set A_i to 21$ ?. E# E6 ~# F0 \/ r8 I2 u
    move into Q_induct3
& r, c0 p& @1 P    move into pickaisle.induct38 t* B, M; u  h$ w. n/ w) ~# X
    while A_i<=30 do begin- @" y2 H3 ~% `9 a2 e* [! F* T# z
        travel to pickaisle.con(A_i)  v5 y" d7 K! i; T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) q% x* Q; h7 o. ]! a! q: L
        else wait for 10 sec; |6 N! Q- t/ B, |5 R) E
        if A_i=A_leave then send to die
$ n* C- Q6 _. G/ v2 i, a- A        else inc A_i by 1) L- T5 n8 Y, t5 L6 \
    end
# T6 i) C8 n& Q, fend

最佳答案

查看完整内容

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是个什么东东?9 L' A1 s" B; l+ Y1 e# v- k0 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: l4 g) x# }; E, l; Y, \0 K. L0 y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* `2 ]" B# \3 l: m6 i9 G: m6 q5 {& E% U7 L+ B) [5 g5 ^5 ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 D) \$ X, v7 P- p# J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' e) h/ ?7 L" p1 v, A1 B  }
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 @: B/ I) R8 E/ L4 f3 B7 D5 z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( r* u6 z# ^, f, E% W* nbegin P_induction arriving
" o3 F; ~( Z. S    clone 1 load to P_pick(A_induct)
4 R8 f9 \, n: b/ X( b: m7 Cend最大的系
8 g. D' w% F# Q) u: [& B' W
4 C" ^/ d- Y. wbegin P_pick arriving
/ _' @% q4 s1 T: ^1 \    set A_i to procindex * 10 + 10 N2 C& |$ }  Z6 N/ q
    move into Q_induct(procindex)
: N1 t' }, d9 X4 w/ V    move into pickaisle.induct(procindex)
& K! X3 B' l, ~9 x    /*check the type of pickaisle.induct(i), for your last problem.*/
% Y8 y, W1 Y$ l6 [  X" G  J7 s$ f: v) @0 n8 n
    while A_i<=30 do begin. L) f6 H5 i. ^' @" w1 ]0 R
        travel to pickaisle.con(A_i)
7 S( R6 N$ @! e) `. l: Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, E3 Y& C% y& C        else wait for 10 sec/ L( D3 y5 c0 {5 t2 ^
        if A_i=A_leave then send to die
/ D$ `% O" j9 V: m+ x5 j        else inc A_i by 1
" |4 u# n; D4 {) Z! `# e  g' {    end
+ \- F5 x* \( d! _3 D5 s# zend+ D' O2 [/ A' b4 m0 `

4 n- t# Z8 T' p" d2 T4 i其中的procindex为整形,代表当前process的序号。
7 S* b+ o6 Z9 j5 j+ }. Wstation和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-7-29 10:13 , Processed in 0.014619 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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