设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14068|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 G& {7 f2 ^  U% \4 G9 s- U
& V; \  N% U# m$ p2 x* y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ a2 F4 u. o- ]. j% I

+ s6 c7 n! y2 a0 hbegin P_read arriving
9 F( p. ?" Y  C' A: N    while 1=1 do begin) A/ F; K4 \0 |  u5 Q' c  j
        read A_tote from "data.txt" with delimiter "\n"
8 ~1 A0 `' [* B+ l  ]        read A_time from "data.txt" with delimiter "\n"
4 ]$ `9 b% m; V+ E; n, |        read A_leave from "data.txt" with delimiter "\n"3 Q1 m( z) S; S' X$ V4 L
        read A_picks from "data.txt" with delimiter "\n". O4 m) ]* |9 `7 O; n) _
        set load type to A_tote
" }0 Z5 s: P0 v: F" x1 [7 U; [, F        if A_tote="tote 1" then set A_induct to 1
% A* a9 m& G4 i: d9 B6 Q        else if A_tote="tote 2" then set A_induct to 2; L. M3 Q; C! f7 r, X9 Q# F
            else set A_induct to 3   
% l5 c' k; B  K& n        set A_i to 0
9 a: R: T! Y6 D. L2 e( M        clone 1 load to P_induction) \* S- X) E9 }1 s0 ?% G$ `
        wait for A_time sec/ k$ I; l  v! C* h; y
    end$ ~; w+ y  ]& _3 }2 O
end8 \: H7 l5 I1 K8 p  n. p# O( Z
! p; G. C& ?9 D) ~) P
begin P_induction arriving* x9 g, L8 r& [# q' @
    if A_induct=1 then clone 1 load to P_pick1
+ S% M2 N) E& H1 L& i    else if A_induct=2 then clone 1 load to P_pick2
/ w, o% L7 D0 B  S# h        else clone 1 load to P_pick3
. i  L7 N8 }9 s# p2 kend
9 |7 x6 E* w: }! M& q, G" O
4 o4 g* Y0 L# w3 Wbegin P_pick1 arriving6 v5 ]3 l, k7 M# z. F1 @4 T
    set A_i to 15 O& p1 m4 S9 G- R: V% D
    move into Q_induct1
# O& C2 o1 y/ M6 T! M3 B% f  N    move into pickaisle.induct1$ W5 j9 a) T2 ]) V; K
    while A_i<=30 do begin
+ G( b" C2 r! p" u        travel to pickaisle.con(A_i)& N! c6 x* F% E5 u# @, m  A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Q1 G2 R+ {" q- T" L9 f
        else wait for 10 sec
9 E3 j& V$ S5 Z% f4 I* j0 g( M        if A_i=A_leave then send to die
4 b  y9 x! r) E2 w3 ?0 f8 z+ `        else inc A_i by 1, t# |' z& Y9 |! ~1 C0 \
    end
1 ]! t4 r5 o0 G( q8 @end- g# h8 x4 M4 s$ A" C0 r

) o+ c% T# U* |; F& `4 T- Bbegin P_pick2 arriving
, R) d1 h8 m# ]1 m    set A_i to 11
* m( D/ {# p3 v7 b6 T- y    move into Q_induct2
/ l9 O- i% h2 M3 y5 v    move into pickaisle.induct2
6 J+ S( n) P, h0 E% R8 Y! J/ x# k    while A_i<=30 do begin
+ N2 k$ A  f9 L% z; C% i8 Q        travel to pickaisle.con(A_i)
0 _, c/ G% a7 A8 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ [. j' Z% m7 Z        else wait for 10 sec
: z. R# N3 R% d# x        if A_i=A_leave then send to die
+ l  [$ H7 b$ A6 W        else inc A_i by 1
3 H+ P+ m0 d& W- K* `+ B    end! |5 P8 P! v5 Y$ ]' n: t/ d# y, u
end
$ ?% ]5 ^6 V2 L" L, J2 l; i8 z8 S+ s0 v
begin P_pick3 arriving
1 T9 i, G6 e4 n7 C9 r6 c    set A_i to 21
4 t. {! |, u0 `3 I. h    move into Q_induct33 j: F' f5 q# d, Y
    move into pickaisle.induct3" h# s& d  A/ J5 Q0 [
    while A_i<=30 do begin- D( o# `6 M8 t+ _/ L* r
        travel to pickaisle.con(A_i)
, x; \/ \1 v; h& Z; M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ |. w3 U) ~; V( c7 f) h, L        else wait for 10 sec+ R* e0 Q  K( l. Z" z
        if A_i=A_leave then send to die+ p5 s( t* t6 y1 z% U  R
        else inc A_i by 1
+ V/ g+ ~. v4 r+ |8 t0 R+ @    end
# ^# r! h* S; N& r* g8 h8 B4 }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是个什么东东?
* z5 x- p8 g" Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 O' k5 z0 C9 Z) p2 i% \, I% P' O, q0 \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 A* e% d7 O. i

5 q0 D4 p, _8 v. g6 V( M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% c- H* v+ n4 E2 U1 K' n% q* h: [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" K2 ~' `. g, j1 J4 h+ S; f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ U6 p: M0 U8 f% Q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 t. b, f1 _4 k5 O; O6 d9 ?begin P_induction arriving
7 ^0 K5 U  c. U6 m" ?    clone 1 load to P_pick(A_induct)
0 q5 E- o0 @1 ]& M+ _/ R- w1 I, X; ~end最大的系( ]' i/ Z& I% `6 \: L* f3 L& n! j% i- g

* C; c; d7 S, l& S, ybegin P_pick arriving2 I6 X) {9 F. S$ V
    set A_i to procindex * 10 + 1
7 f" x/ F7 R- K# j    move into Q_induct(procindex)2 f' j9 C! |! D" m8 B
    move into pickaisle.induct(procindex)
; }8 P$ G; ?, i8 n& f; L0 `    /*check the type of pickaisle.induct(i), for your last problem.*/& R; ^0 Q' k) P1 n: Y

: u& l2 x* Z9 M* B    while A_i<=30 do begin& ]# q  f7 I) ^* _9 I  g& _
        travel to pickaisle.con(A_i)
/ |/ _4 Z0 ]) c; ^. U7 |0 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. d& o$ i  c9 ~! g# k
        else wait for 10 sec" B" b& s( z( k: Y. w( {
        if A_i=A_leave then send to die' \- y* \) V" v& {
        else inc A_i by 1* L1 \; J& n  m3 V" _
    end
. F9 X) E2 P; P  X8 `- k- ~) N: hend: M+ G, l& Q; s) }& H0 r: m5 A

% n) A  K9 ], Q! ^% |. n其中的procindex为整形,代表当前process的序号。
9 S7 F6 i0 z/ G+ Fstation和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-5 09:45 , Processed in 0.015761 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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