设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13899|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ s" }1 B! D, M4 D7 e% w
& i; Q$ J& j5 {; q) ~+ B
我的问题是,在每个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 h) _2 S8 y' d9 D; D6 Y7 e- I% w# n8 p0 l
begin P_read arriving, g/ `/ }5 \5 k/ x$ h
    while 1=1 do begin, L3 U+ W% L2 y" z1 ~3 {! \! }5 e
        read A_tote from "data.txt" with delimiter "\n"( b4 t5 k8 @0 `( ~, X1 r2 w
        read A_time from "data.txt" with delimiter "\n"6 t/ ~. Z! d, z: s& @0 ]& ^# W
        read A_leave from "data.txt" with delimiter "\n"5 n- |( w, @  \
        read A_picks from "data.txt" with delimiter "\n"
$ Q- l6 X4 L+ j6 i& [7 U        set load type to A_tote/ b% C$ ]* f. v
        if A_tote="tote 1" then set A_induct to 1
; [2 ]$ n- D& E1 l6 e+ \) R2 k, N        else if A_tote="tote 2" then set A_induct to 2' m1 [7 Q& `1 |
            else set A_induct to 3    $ t5 }2 M- G& G, o; c' w& K. M
        set A_i to 0
. d$ K6 l  o8 }, v" W% ~        clone 1 load to P_induction" p( D9 _8 O- f- j9 H6 ^
        wait for A_time sec
. O" R5 t) h% a/ v5 {    end
+ Y  c1 F' @' f% Z7 e9 K) H# m* Kend2 o! g0 d" ?1 Q! ?" y2 U1 i2 R
8 H, |' G! g7 d
begin P_induction arriving* ]) a6 V8 K5 B; }9 ^8 [0 H
    if A_induct=1 then clone 1 load to P_pick1
" e; p( u$ F% P0 R7 y- y    else if A_induct=2 then clone 1 load to P_pick26 E" h7 M& J9 [1 Z  C1 W7 u
        else clone 1 load to P_pick3
) I" h' R/ _9 t0 Z2 c6 f- F+ Lend
( K8 a* ], m2 Z- x- _" m* H! g" f
# A" }$ T% t' z. Ubegin P_pick1 arriving
" y* B4 k1 M$ l, g/ k    set A_i to 1" A( g9 G5 ?( t) A' [6 U) y
    move into Q_induct1  m% x( E0 o2 y3 O
    move into pickaisle.induct1. |7 R2 O+ ]! }* E7 z
    while A_i<=30 do begin
) L  d3 D  S3 d        travel to pickaisle.con(A_i); [0 a2 T6 L( }' [- z3 |" x$ j8 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 `6 f" z6 g8 T& D
        else wait for 10 sec. M$ E) S# J" R" j! s3 R) b
        if A_i=A_leave then send to die) L# y1 l- \/ `  u) B3 M" ]
        else inc A_i by 1
! ~6 E% L  Z! K    end0 ~% v1 K* w" _' }4 R- @8 ~
end
* Q9 _) X) v' h- ?# O- u% O! |* l
begin P_pick2 arriving) A$ H* t; y7 r8 `* i
    set A_i to 11
1 S; D0 c! X( X3 y) t    move into Q_induct21 e/ l" B) F6 r5 |7 g4 S
    move into pickaisle.induct2# M; K" F) A. T) S
    while A_i<=30 do begin& I9 n2 c" G* g6 y  |1 v& l3 n; K. Z" v1 e
        travel to pickaisle.con(A_i)
+ m3 B1 |6 Y" I+ _% X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  ?$ T. H4 v4 @( y4 J
        else wait for 10 sec
6 k2 g6 t# L/ G- h        if A_i=A_leave then send to die
/ v: n* V$ M; Q1 o        else inc A_i by 1
1 k+ ^% z6 w+ F- t% _; K    end$ y. D6 u1 M6 V; c3 \
end
. p" E7 d$ Q5 n2 t) C
% j( K  B: U7 r; y$ F# P4 H$ m& G0 Wbegin P_pick3 arriving" R0 b: K8 M5 _) z( a
    set A_i to 21$ c7 a2 D1 q/ S# y
    move into Q_induct3
# \! w3 Z. k0 [2 p. Y- i% f    move into pickaisle.induct3; }4 F& P4 a, f& Y4 p* `
    while A_i<=30 do begin! T# L4 u' r7 W
        travel to pickaisle.con(A_i)
9 B7 H5 Z/ n8 H5 G6 }, `6 |7 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 J1 a; ~: `( T6 t7 ?! o6 R
        else wait for 10 sec
  H8 ?7 h- S. u: v5 n% X        if A_i=A_leave then send to die% f" X7 i& \& O3 K
        else inc A_i by 1' [) V7 f& {+ g& Z4 W! K
    end
2 f! o' l! Q7 M) z  b9 l6 u0 E, Bend

最佳答案

查看完整内容

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 \5 e2 K6 Z. p# [6 j% m! S. F, w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; s- I7 G/ I8 ]$ I* w

: s3 y$ w( v+ O; n  M' PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; O7 t# Y8 u# X8 p7 v
. j& g; {6 G) F! d# I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& d! ]) f  ]1 T3 ]; N, E$ p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 u  d5 o3 f5 n4 ]1 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% k8 d. I3 {7 j! }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) V) C0 f2 `: w. X) Vbegin P_induction arriving. p' B6 O& y9 C4 j9 o
    clone 1 load to P_pick(A_induct)
5 H1 y8 e  z0 m9 K2 kend最大的系
* Y9 t$ ~0 _0 v% ]
0 w) S* g1 F, k( x5 b( }7 {begin P_pick arriving' n0 ?$ g- u% p* b! [3 c
    set A_i to procindex * 10 + 1& K1 U" q  p+ W0 C$ |
    move into Q_induct(procindex)
. M* n3 z; V1 K$ z    move into pickaisle.induct(procindex)
" G) {+ C$ P' U/ C3 U    /*check the type of pickaisle.induct(i), for your last problem.*/
' X7 V7 o% o% r/ T" j8 G7 K- [' o; p; w, z  U3 U' A( O6 r
    while A_i<=30 do begin
0 I0 r" L* {% Y, y$ i" ^        travel to pickaisle.con(A_i)
- N. p! b1 q5 m/ ~, @7 M! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ]+ |' A* v9 X4 }3 p2 ]        else wait for 10 sec
  x2 @2 ]0 R" `, j, {3 R9 {) J        if A_i=A_leave then send to die
# C. \- ?* o% x% f        else inc A_i by 1% Y2 z3 `, M# o
    end
' ~# i1 @/ L( q. ^! Y# J. iend* D/ h- Q- ?5 r0 O( H. O
# ?0 R8 ], P- x3 U; [" C2 I1 Y
其中的procindex为整形,代表当前process的序号。1 B( f; J; Z: x5 n6 G
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-5-16 16:29 , Processed in 0.026433 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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