设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14214|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) z5 b% `! v7 ]0 X  q1 ~! ]
$ ~0 d8 L+ S  T+ G/ k我的问题是,在每个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 ]  W" T  n# g6 s1 \" \: f1 O  _  T! y( g- u$ q$ \
begin P_read arriving; R8 L3 G1 C' K
    while 1=1 do begin( b$ B5 {" A, i- I# j9 C
        read A_tote from "data.txt" with delimiter "\n"+ u; W4 R) s4 D! r
        read A_time from "data.txt" with delimiter "\n"
" w& e3 y5 _2 }9 ~* O        read A_leave from "data.txt" with delimiter "\n"1 Y! T) ~4 n0 h# ]  h
        read A_picks from "data.txt" with delimiter "\n"
9 n, ?% Z+ e' j" ^        set load type to A_tote
  w/ V! q$ V  l, H# v5 d% Z$ S        if A_tote="tote 1" then set A_induct to 19 K; ~1 M- |& D
        else if A_tote="tote 2" then set A_induct to 26 n; g- ?" V9 D
            else set A_induct to 3   
6 e' [9 w4 s! q( Z% Y& H        set A_i to 02 A) Q; ~& p* C) b6 d( Q2 t
        clone 1 load to P_induction
' o% B- U; d2 e% i7 \9 R3 ]        wait for A_time sec8 V9 {' k7 K' |9 l# ^9 Y
    end" F  X5 z4 U5 Q
end7 r4 X* e" w* I3 _2 C

' P3 r8 M0 X. a7 |- B# jbegin P_induction arriving0 U* r. \) k; q1 Y
    if A_induct=1 then clone 1 load to P_pick1
, \' Z  u' k# L/ h2 O3 K    else if A_induct=2 then clone 1 load to P_pick2
) a+ |% j% t# B# b! H4 ~6 M7 D1 h# t        else clone 1 load to P_pick3# f5 L, Q) P5 p1 I2 m* e. z
end0 r! r9 R' ?* v" s5 ?
# G# V1 f' g  r- W% G  M; U
begin P_pick1 arriving! j/ z/ X6 t; Q( u% ^' ~
    set A_i to 1" [: c# O& N% p0 Q) F: |: u
    move into Q_induct1
! n7 A" G. m) J+ G7 ~. I; E    move into pickaisle.induct1
+ B/ L% }  x) i2 K' `    while A_i<=30 do begin
" W, ~2 h: b' X  b8 x* o1 p        travel to pickaisle.con(A_i)
& x# ?9 T5 P9 h* X: G' |) |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 u7 r2 N4 ]; y4 s/ W        else wait for 10 sec
5 c, v( R3 J, B* q4 P        if A_i=A_leave then send to die  [/ R! H% ^6 y0 I
        else inc A_i by 1  \0 d, \. P% [7 r6 K0 ^) q
    end. O  V0 v% D" S, g' C
end
6 b, _8 h7 N" S) Z: J% k7 F# n  n5 T( \" P, D
begin P_pick2 arriving" F: w. v. i7 k: V  {4 \
    set A_i to 119 x8 U( ]: ]6 {+ C; y4 t
    move into Q_induct2- H+ F7 s) }& Y2 m
    move into pickaisle.induct2
* H6 m, a- p1 ?) R) m" A4 c& ?! w    while A_i<=30 do begin
' U9 F7 U7 n% S        travel to pickaisle.con(A_i)+ T( [8 m1 d. o4 O7 ~! |: F$ l! i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: m0 ?4 Z+ L' j- t5 C
        else wait for 10 sec
! ^$ P0 P) n% p9 B: m7 Y% e        if A_i=A_leave then send to die
" v' O3 ?/ d2 O& i% e        else inc A_i by 1, F( n2 \6 c  S
    end7 X& s1 y2 v- c$ P
end
# X2 P1 w* L, I/ l9 \, q! y+ C! A) K( o* `) Q
begin P_pick3 arriving
' }& \6 O+ O# C0 q' ?, @2 Z    set A_i to 21
6 N8 \6 ^' ~  R2 v& j8 F    move into Q_induct3
* \! Y- l0 k) `/ `1 @# K    move into pickaisle.induct30 O0 O" g/ H" E, t/ B% v
    while A_i<=30 do begin
; `9 ]$ U! u6 t1 L% u) J; e        travel to pickaisle.con(A_i); S! P! q. x* R  j# A3 F* D( p  I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^7 f' E# Q) C! U3 I
        else wait for 10 sec
0 ]4 i6 h. A8 i        if A_i=A_leave then send to die
9 w! \9 {1 j2 J, f        else inc A_i by 1
  T$ o1 `7 z" F    end
# S- Z* a: p' a0 m; Zend

最佳答案

查看完整内容

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是个什么东东?
/ B9 {( Y" u! q, omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 u) f" Y+ O: s, H# p" _7 e
, Y; W' N0 ^' ]. q3 J2 \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 w$ i4 _! w; ?1 ?
% W+ Y5 ?; m$ p3 g) S/ w9 m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ M/ u) f5 F3 X/ h# J# N/ i, |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  W" Y0 D! o" F! V' P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 a) }- W  [, D: {* p! u7 u8 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: |+ m1 \1 u! K, S% |+ C0 Z% rbegin P_induction arriving
# a. X/ y, r# h- h1 o9 H" f    clone 1 load to P_pick(A_induct)7 I2 G+ _( }6 i% d* M
end最大的系% K6 X2 R' r' c. ]" X! r7 m
6 K" R8 [4 H7 o4 L0 s/ ?
begin P_pick arriving
' {+ R3 H1 g+ {    set A_i to procindex * 10 + 1
$ A- p$ a+ W/ g' g% L    move into Q_induct(procindex)
8 L- p8 S4 ^$ r& X8 q/ u1 O7 [" c    move into pickaisle.induct(procindex)3 i" ~2 A7 g! Z$ V
    /*check the type of pickaisle.induct(i), for your last problem.*/
! ?2 k; q' c% @* m* p! z0 \" B+ \) _3 r7 s) z' o% W5 L+ l
    while A_i<=30 do begin
9 {( A4 ^1 A% Z. e5 T4 Y        travel to pickaisle.con(A_i)
; @1 }: ?0 P: W* u( y4 Y6 d  e9 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 L0 y4 g! g& K        else wait for 10 sec- C. a: ~/ F) T. Y: J
        if A_i=A_leave then send to die+ Y( T* n) ^& Z: S. n$ r" c
        else inc A_i by 1
" r2 f* U  ~: ]. b7 R  b    end
4 }& `! E& E( ?# s) Vend1 ~% j; s/ I- G( t. _3 V7 X

! Q) }0 Y( r8 [+ z其中的procindex为整形,代表当前process的序号。
/ K, H1 V% ?1 L$ H  n$ Q6 C2 j6 \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-21 17:55 , Processed in 0.014511 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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