设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13476|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* w" f  N6 `0 [% a# @1 D( y+ b' X3 Q  x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: K2 n( K: {) R# b

' y2 e- `( F9 f0 N* c5 Ibegin P_read arriving" g0 B; d9 z3 _( G8 H+ I$ W
    while 1=1 do begin
3 ~1 m' L) E9 _0 F% d/ C        read A_tote from "data.txt" with delimiter "\n"% F: S$ M! H* z0 N- W+ I6 G' ^
        read A_time from "data.txt" with delimiter "\n"2 {1 d  _# |$ Y2 G! f$ K
        read A_leave from "data.txt" with delimiter "\n": P3 P: a6 P0 _, s' U
        read A_picks from "data.txt" with delimiter "\n"
. z5 ^) w0 O& d. j        set load type to A_tote3 A7 s! U! M9 G; V) ]& z
        if A_tote="tote 1" then set A_induct to 1: [: ~0 M' q* {# r3 _* Q
        else if A_tote="tote 2" then set A_induct to 2
; A6 w0 V9 }) U            else set A_induct to 3   
, L$ F4 K; w+ B) ^7 U9 {8 W        set A_i to 0
5 @: ^$ s9 R1 C# _1 k5 R        clone 1 load to P_induction) ]& w$ s- @' |* @' `& z
        wait for A_time sec: ~5 d# l* m8 b$ B2 L' q4 I( [
    end
( Z8 X) I. k$ |  }4 Tend
! }2 k, q8 p1 m) l
7 S  i( N' y8 c4 _6 ^$ Q6 A& j# Kbegin P_induction arriving/ V' u7 Y& |/ V( }4 D' I
    if A_induct=1 then clone 1 load to P_pick1+ m- ]5 j2 }, G( W
    else if A_induct=2 then clone 1 load to P_pick29 W! v! u; b/ b: _" M
        else clone 1 load to P_pick3
- U- U3 Z. ~6 B) Bend( }6 F* A( d7 {: }
* j9 g/ ^: s) _9 Z8 n% k4 f( j
begin P_pick1 arriving
( H( G1 q' W# P# n) T3 `$ {1 s    set A_i to 1
( [$ o+ [# D( [  _% `    move into Q_induct1
1 s* Z2 K- y5 p) d$ s% \6 Q    move into pickaisle.induct19 I; B; h% W- ^2 a8 f, G8 v
    while A_i<=30 do begin
# ]. M2 P' c$ K- a        travel to pickaisle.con(A_i)
2 y9 U2 H, o( |, u. u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ^9 _( {( u6 d" }
        else wait for 10 sec4 \$ W$ ~$ p2 D8 K) n: u; D
        if A_i=A_leave then send to die1 e& B: @9 A/ R8 p4 O8 Z: B3 g' o% b
        else inc A_i by 1' l; h0 v* F, X: T4 Z/ ~
    end! s) J% v; y* l2 m
end
$ V  n+ u8 Q; d" h. l; f
6 H3 p5 y+ B* P7 r2 ibegin P_pick2 arriving
: |0 B7 T, B' R    set A_i to 11
* d- |& N# x& R7 _* ~    move into Q_induct2# h' y( F2 A8 k' j6 w2 M' a
    move into pickaisle.induct2
% g, v& C$ l# P  L- `& D: F0 j    while A_i<=30 do begin2 }5 v& B% @) ]7 u; a+ f- ]$ R
        travel to pickaisle.con(A_i)/ p/ V5 T* G/ w2 L2 I# ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N, ?$ K9 ~& U' ^# ]7 J        else wait for 10 sec& T; g4 f0 q0 G6 j9 w
        if A_i=A_leave then send to die
9 r: O2 X/ m) \* A        else inc A_i by 1
$ k9 n( U. Z/ D$ \6 T( w2 I    end
/ b6 {) b: Q! g  |end! T7 g) h" V' [" M
9 R8 @6 @* s# i: f2 v- [
begin P_pick3 arriving
" i( N, E1 o7 U3 c5 E" W    set A_i to 21
& E" g+ {4 i) b9 _2 m    move into Q_induct3
% U. m8 \5 C, W: @! n! ^    move into pickaisle.induct3
# H% q8 S' o1 G( k6 f0 }    while A_i<=30 do begin" m! n( k. R' T8 O% B& O
        travel to pickaisle.con(A_i)
/ ]! Z, U. i2 z$ w, Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 w5 E2 h3 v6 {3 [% j  u5 l( J        else wait for 10 sec
' r8 w( s% U  Z3 i        if A_i=A_leave then send to die5 D/ D8 h- \2 D  a3 q7 }
        else inc A_i by 1
/ C( s0 r' o$ h3 y% V+ z    end
& i  a: @( r  c7 e: ?' Vend

最佳答案

查看完整内容

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是个什么东东?; Q" _& r$ i4 Z3 u. d7 i- D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ ^" Z; O% j8 _2 j) x7 n# L( d$ x- x2 R8 z1 \4 o5 @
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 j- s4 {6 c. O/ ?
3 \7 l/ e6 F7 _* n5 }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 ^! j, O; }- E$ X6 }. I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 b( S7 T- b; w$ ^! X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 H% k; R0 I3 p% L$ r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! S" K2 j: B6 \+ C$ A6 Q
begin P_induction arriving, \5 n: D5 E- E1 w9 A* V
    clone 1 load to P_pick(A_induct)
/ r  W' w% a$ E  K, B6 pend最大的系: K* H: T: D) T1 y7 C& b; O
& Q; [: S8 p6 {+ e4 e( P. j2 h7 M5 |6 L
begin P_pick arriving
5 n* U" U0 r$ N7 N4 d    set A_i to procindex * 10 + 1
! D, d5 t) J3 g+ h4 r, b    move into Q_induct(procindex)% S& p) A/ W( a1 b" E
    move into pickaisle.induct(procindex)/ @1 _5 V* R( N8 w" \
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ e$ r& _* R# F3 |
  e, f3 Z* Y  H& }    while A_i<=30 do begin
/ k5 s4 f' I- a6 k        travel to pickaisle.con(A_i)
+ e& J8 ?  v* F8 t5 m$ E1 `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: X* q% C2 B( p9 S2 M        else wait for 10 sec! _+ z; c) H! K# x
        if A_i=A_leave then send to die) R' Q" f4 f5 R* p4 n3 H
        else inc A_i by 1, g/ Z5 f* O7 N6 W1 I8 k0 E
    end6 P  V9 k% ~( s9 E3 Y9 P6 @
end; Y' D$ D1 I* f% ]+ `1 p3 d
  q- M3 G7 n8 L$ ~8 L) Q
其中的procindex为整形,代表当前process的序号。
1 i( f8 X4 O1 mstation和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 02:58 , Processed in 0.017923 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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