设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13491|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( |4 K" w& e5 c2 V
: q; ^2 o* ~9 M我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" m8 \& t( L4 ?
$ Y# r/ i; ]% {2 i/ `4 ebegin P_read arriving
; p" \; H3 x) @" u& |& r    while 1=1 do begin( T4 A* r7 X2 @. ^$ k& [
        read A_tote from "data.txt" with delimiter "\n"4 t# P; U. ?8 K& e8 C! L) M+ @0 E+ H
        read A_time from "data.txt" with delimiter "\n"
/ E7 V% K5 ?7 ]8 ]/ Z" b( K        read A_leave from "data.txt" with delimiter "\n"
3 C, j* c* Z5 u- ~+ E, v$ D        read A_picks from "data.txt" with delimiter "\n"
6 d8 A9 v5 p; v1 }" U' i        set load type to A_tote
5 z/ r' t( B2 ^! R0 c        if A_tote="tote 1" then set A_induct to 1# u' ~+ w0 m- r8 i4 |+ K
        else if A_tote="tote 2" then set A_induct to 2
- b9 Q! R' n. R6 P  f            else set A_induct to 3    2 B$ l" Y6 J# l5 P6 j* i& w
        set A_i to 0
; K% s* L" F' H/ g        clone 1 load to P_induction7 u, v& S, `$ x6 `2 E5 T
        wait for A_time sec) ^1 j7 U, Y0 S2 e. J2 ?6 X
    end7 q2 h- O* u0 B  B
end1 c# d. V$ G. B: c

( V+ V  J, c7 h  y/ zbegin P_induction arriving
; r8 J5 e& ~- {0 Z: _    if A_induct=1 then clone 1 load to P_pick15 j# ~8 i2 w, e5 K9 \
    else if A_induct=2 then clone 1 load to P_pick2
0 M# S" ]3 L2 W2 ~        else clone 1 load to P_pick3
# E9 |" |" j4 V$ c+ V% z6 A# Dend- |  d; t6 d' c2 Y& V) i
  P9 P9 M1 T5 ?+ e: h
begin P_pick1 arriving) \  l# m0 P& E1 Z; U
    set A_i to 1
- B2 ^; m4 j3 [9 t/ E* @) o7 F    move into Q_induct1) K7 X3 K% J5 q
    move into pickaisle.induct1
8 V8 c5 {& C" c- X    while A_i<=30 do begin
' Y& w5 K" E2 X5 O3 ^1 z9 Q        travel to pickaisle.con(A_i)2 n6 i5 L1 M9 G) O9 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 R# A1 a# n4 z. _! v
        else wait for 10 sec5 n  Z0 e' C5 F8 E/ T# i) `( x& x
        if A_i=A_leave then send to die, J2 A; X3 J) ?# d, d# o& D( h
        else inc A_i by 1$ O, a! }" f# C( ^- F
    end
! S2 D- ^3 B* eend
9 g8 G4 ^' S, Y' @/ m8 N/ `3 p4 k! @+ J( Y
begin P_pick2 arriving! H" f8 ~& `) s4 ~* d3 f( Y2 y6 u
    set A_i to 11
9 L' |& f5 Y  n( s    move into Q_induct2- m/ ~. L" v, d- u/ p/ P; v
    move into pickaisle.induct23 ?2 O% ~4 U% D) ~* I' u
    while A_i<=30 do begin4 j; N, |) ~' d* P4 R' q  H& }5 W
        travel to pickaisle.con(A_i)
9 z( r: s$ L& w! ~7 M5 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: h  R% C$ @3 t/ T/ T" p* i        else wait for 10 sec1 s- o) M+ j" l  E, Z2 Z9 _
        if A_i=A_leave then send to die
% H/ n1 W+ G6 E$ B1 L! O        else inc A_i by 1
5 b3 X& [) l- u# c9 h    end" ^0 K5 X# n# g+ n7 G
end
: N# J# Q: h9 Z+ {% Y7 `$ N/ K1 n4 l4 r
begin P_pick3 arriving
4 e$ y# H: Z1 o    set A_i to 21  h! S3 ~3 y/ ?/ h9 y+ z
    move into Q_induct30 _0 Z7 {0 r, A
    move into pickaisle.induct35 z/ q6 S4 [* B8 M2 v3 A% A8 F$ p
    while A_i<=30 do begin
1 A$ ^: H1 a- H* E5 F( S$ }        travel to pickaisle.con(A_i)
3 M9 e  N9 H$ T4 z7 s/ A" x! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ S2 H' c" [  w        else wait for 10 sec, x# L' l. \( W7 @% j1 R
        if A_i=A_leave then send to die
7 n, j; X. ?  ?; v  s5 }        else inc A_i by 1* G$ O4 x) }/ X9 d5 n5 p
    end' Z6 x0 B+ ~; D1 o' T
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是个什么东东?' Z, ^: O" o5 j) u: _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 V# [% k$ }2 F& X
" `6 @' p  F: m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- e4 e- O% V8 \( ~4 U! E/ l3 z
. c/ F* a9 `* L1 l6 A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  J) c4 ~& X: u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 G, D$ c0 Y6 p# ]. d( t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 a7 l5 l4 d! S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; B7 h: M' b9 v+ \  J! w' g, {
begin P_induction arriving" e5 l. x% _. P, d( Y$ O
    clone 1 load to P_pick(A_induct)" b7 [. u$ e3 t  _
end最大的系( o/ w" _4 t, P  {) r

8 a7 W$ h; T8 d/ ^2 A4 Hbegin P_pick arriving
& g# m1 x! s7 b. T7 {1 V    set A_i to procindex * 10 + 1
/ L# A; b& ^" n$ \    move into Q_induct(procindex)
+ z. A# B  B9 T- P; V    move into pickaisle.induct(procindex)
0 t2 x8 W  p8 s" K( K    /*check the type of pickaisle.induct(i), for your last problem.*/
6 l$ H" L; q4 e2 ~% \4 }; [& Q) o: y: F: _
    while A_i<=30 do begin8 q7 R. t" j9 t9 c% N
        travel to pickaisle.con(A_i)
- X, O9 b- ]6 h( n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- u* H6 d3 p7 A! \        else wait for 10 sec# A* U# d* n% S1 Q% n3 z
        if A_i=A_leave then send to die
' o  ^/ N% h/ ^  Q- S        else inc A_i by 17 h1 n6 G& @+ g! S9 a
    end
+ z$ ^. f, q$ O" `end6 C* j* O0 M( s, t" \1 }- @

3 B6 m6 T9 C' l" L" v8 W, `其中的procindex为整形,代表当前process的序号。
1 j9 y2 S( N5 a5 o) ^8 x, a# P- Zstation和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-4-17 17:34 , Processed in 0.019380 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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