设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14090|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: J- m3 F7 a) `6 O) v
' n5 z1 R9 [0 J' I: a: J3 C# B3 I7 C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 c. H* h3 g" [# X; S3 f4 C1 Z' c  D5 @5 _2 M
begin P_read arriving
, @, r. z' F: k& P8 g    while 1=1 do begin) |: i3 g& G' s
        read A_tote from "data.txt" with delimiter "\n"
9 F; L+ h3 e. z: b4 ?- h" P# B        read A_time from "data.txt" with delimiter "\n"
4 p  J8 Z. l! B4 ]6 g        read A_leave from "data.txt" with delimiter "\n"8 {; A5 j0 Z" X! w# r9 P  R
        read A_picks from "data.txt" with delimiter "\n"
7 i- P+ A" r8 ~8 ^6 ]$ o4 G        set load type to A_tote
% }9 I$ W. E+ o( [2 a$ h7 @        if A_tote="tote 1" then set A_induct to 1: l1 K% x- ]  F7 p' j; K
        else if A_tote="tote 2" then set A_induct to 2
& L( C3 [% `6 K/ M# N6 G$ S            else set A_induct to 3   
" N4 s/ \/ R5 ]  c7 `5 z        set A_i to 0
( W! @1 b" d/ K; @, g        clone 1 load to P_induction
" j( a$ Q/ W* l        wait for A_time sec) S  w1 M- @( O1 a/ `
    end
1 q- L. `- ^. I3 `end0 H  }% l0 F, O) {
/ J- G3 s  D* m2 M% m# R) ~$ S
begin P_induction arriving& c1 g) }2 r4 y4 P/ a# s  d3 ?
    if A_induct=1 then clone 1 load to P_pick1! p9 t2 c* k+ ?, b9 a( `" R) O
    else if A_induct=2 then clone 1 load to P_pick2
  A+ ^) A7 ^% c% z( g        else clone 1 load to P_pick38 b) _6 v# E) X' r; ^2 t% E
end
. _+ |: M* z7 }3 q: `( o. R9 D- p" V( c
begin P_pick1 arriving* _$ y) M* w( Y. \$ {
    set A_i to 1
  _) h$ \' T. Y    move into Q_induct1
, k9 D, ]" |3 X$ G  R; P1 g1 X    move into pickaisle.induct1
8 f' e6 Q9 u- S9 @' X" B  I5 u    while A_i<=30 do begin
" W' r. o% y6 d" A6 q        travel to pickaisle.con(A_i)
5 i# |5 d7 c/ Y/ _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: q! u3 V* ]' P; t
        else wait for 10 sec
6 d: R" }0 t. [- T) L) J        if A_i=A_leave then send to die
; Q2 J: M$ I3 y! x" T3 e+ N        else inc A_i by 1
0 \: N. V/ z' f: X    end+ u. b8 J1 X' b$ |$ d, E' i3 s
end/ a0 T' E* g- k# \6 _% ]

$ V( h5 N/ y* D/ ~& x' Y( Wbegin P_pick2 arriving3 C# ~0 l7 E( {1 q; D2 ?
    set A_i to 114 O& A4 y- z& `2 [. C
    move into Q_induct2$ e5 w- z4 n% i8 O
    move into pickaisle.induct2
. c; Y6 u. Y: b; P    while A_i<=30 do begin
- L, D/ u7 g1 p  q7 T+ `9 o* s3 X        travel to pickaisle.con(A_i)6 P2 E& |% Y3 s7 d& t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! V6 o6 D0 `9 F2 f$ ]0 K
        else wait for 10 sec6 W. t/ X! v5 a! ~- v, G" N: U$ [
        if A_i=A_leave then send to die
* Y1 b4 M$ x! @4 u- {9 H        else inc A_i by 12 p+ p; Q  H; ]
    end
# {7 D% o& X. X4 oend
3 x3 P) e, s8 f- P, Y; b6 Z# {
# x  |) U/ ~4 B% G3 ebegin P_pick3 arriving7 @- ^' I7 y- @! K
    set A_i to 210 U8 \/ p/ R2 H/ w" W
    move into Q_induct3
. B% h# ~4 `9 J    move into pickaisle.induct3
! S% F1 f0 h( q9 c) y    while A_i<=30 do begin& y- H4 k5 P+ Y9 D
        travel to pickaisle.con(A_i)5 b$ G) k0 Y3 e4 y% o6 |) ^7 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- S* e5 A8 T( m
        else wait for 10 sec2 p7 w3 y9 O' R7 u7 \  O
        if A_i=A_leave then send to die( M% @5 f8 H( H6 O5 }
        else inc A_i by 1
. R, \4 ]9 r) ?& j    end
, @/ `' B* }. y/ ~- w7 Tend

最佳答案

查看完整内容

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 C& U0 G: e+ @3 p0 s3 u, M6 a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  o/ m( b" F- k$ {" I

% |0 r! ?0 |/ o# w# e, rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 \  ?. y) z9 S3 o& A0 |; F7 f' ?- J# F
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& w8 T7 f' R% [6 o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" K( t  L, M) [% u2 v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 V! P% d* d6 w2 O. N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 N' h1 w5 }+ V  P& u
begin P_induction arriving, M) W1 e: B2 |6 x4 q
    clone 1 load to P_pick(A_induct)
1 e. Q" r, s+ S/ p2 C2 _, iend最大的系; H& p* P9 W% i8 X; v8 ]6 }/ K
% o" i% M* Y' N9 Y9 e$ l
begin P_pick arriving
* t9 s* I! I  e: Q9 G; \5 d0 H1 w    set A_i to procindex * 10 + 1
  X( Q7 ~  j6 z" T8 a7 D    move into Q_induct(procindex)- h  Y5 t6 D! @7 R, P
    move into pickaisle.induct(procindex)
- K/ q: z- M1 _5 A& |+ h2 Y# I    /*check the type of pickaisle.induct(i), for your last problem.*/+ @. r7 ?6 u1 N

) a: p" P& g5 f. {  \/ @+ a    while A_i<=30 do begin
6 |4 s  ~' f2 i, J( x1 b        travel to pickaisle.con(A_i). O/ n& W5 J7 z+ O$ f  z' C8 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ B3 ^7 B* f8 J; l- H        else wait for 10 sec5 Y, w6 B6 O. r1 ~7 o% S, [
        if A_i=A_leave then send to die
# j, M* E. c. ?% B( |! C2 Z        else inc A_i by 1
5 V* ?, ^- K! n' A    end& H  |8 i  n# _3 A) N  D
end
: x7 u, |3 w' j3 g/ y$ `
" S4 k2 z5 `- o# V( {5 I" c5 w2 X其中的procindex为整形,代表当前process的序号。# e1 [8 g5 J: Y6 C: G5 c
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-6-7 18:29 , Processed in 0.013518 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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