设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12409|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! K0 s# ^6 b/ b% b& L
( p8 y0 A" F0 D8 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中的数值,不知道会不会有什么不妥。  f: ?- V# |" T' }9 J$ s7 w

* X9 f: \  J' Ybegin P_read arriving$ a5 I/ R, i1 B
    while 1=1 do begin
' R; j' Q) C2 g        read A_tote from "data.txt" with delimiter "\n"
- B; B: S+ A2 V6 c( n4 J  o5 H$ g        read A_time from "data.txt" with delimiter "\n"
$ C" I  ?: I* \8 ^: k& p        read A_leave from "data.txt" with delimiter "\n"' f. e) I) g7 Z
        read A_picks from "data.txt" with delimiter "\n"
" \4 X1 J0 M! y) J        set load type to A_tote
# {1 {4 l4 d  g- C7 N2 A        if A_tote="tote 1" then set A_induct to 1, F$ ]. Q- i/ O, ^
        else if A_tote="tote 2" then set A_induct to 21 N3 b* n- C# e; _1 T0 w$ r. q
            else set A_induct to 3    ( Y! A$ G7 J% i6 ~& G, }( E, I* y' m
        set A_i to 0
) Y; W" j  o1 w" X* Z2 k$ a        clone 1 load to P_induction
* X: G6 ?, P! Q; l  T: J; I        wait for A_time sec, y7 \  F, J' K% X2 d' G
    end
% l  O, j) N: U  v7 B1 \: s3 lend: Z) Y. v& h9 [' P9 e: }" A

+ ^% l4 \9 s% z/ ^" G0 hbegin P_induction arriving
. |5 l8 C# W" E2 N    if A_induct=1 then clone 1 load to P_pick1
5 S9 B4 m4 O5 P    else if A_induct=2 then clone 1 load to P_pick2
1 @3 O! t( @' \. z& ]% ?, |. R' n        else clone 1 load to P_pick32 f4 |; P7 u. X* W+ C- ^8 G3 ~
end
- ]/ F' l' @* ?" p3 a% |' J
) i6 r1 F4 [# U' R5 l3 s8 abegin P_pick1 arriving" R; F- h& h# ?- t1 U! w  B
    set A_i to 1
4 e/ j  u$ d: w9 Q1 h    move into Q_induct12 Y1 h3 J, Z/ ~
    move into pickaisle.induct1) g' u$ R, ~0 |' C+ o0 e# q) D
    while A_i<=30 do begin
6 H- U  p% d- @        travel to pickaisle.con(A_i)
' ^% b& F' ]% v; v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) N2 A$ H$ k4 f9 y
        else wait for 10 sec' p( ~: ]& v$ E1 N
        if A_i=A_leave then send to die
. j; h- {, X+ H" ~4 M; c        else inc A_i by 14 P+ `/ E8 ]3 I' I' Y- k5 K
    end& t5 U- e- v/ H& w6 L
end  q! x" z" P% y
$ ~* e# l( g2 F% ~: a
begin P_pick2 arriving
2 h! z4 Q7 c* F$ b5 v    set A_i to 11% h. j* e' m) v6 ~
    move into Q_induct2
2 g5 Y+ K4 R7 V- w    move into pickaisle.induct2/ M3 Z* t* G' C! c) X# E( ^
    while A_i<=30 do begin
' [, O  S: g$ E0 X        travel to pickaisle.con(A_i)! B4 c# A9 O4 ^" g5 C6 \4 X% d3 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ G8 K/ R7 @* K) ?* i- K" A4 }0 Z        else wait for 10 sec
1 Q6 r% Q5 U' G3 V1 r) d6 K        if A_i=A_leave then send to die
8 `; o' m# i, C. ?0 ~9 u* y! T        else inc A_i by 16 B: s5 z; J2 X7 w  k2 P% k, @
    end0 _- R4 W3 r$ f, i) f
end/ v' R; l% K" Y/ Y, Q8 ]
2 b! T6 @* g) q* h, v2 L* |0 }
begin P_pick3 arriving. M3 t2 S1 e: O4 x" Y# k
    set A_i to 21
9 `" a5 O9 w: v4 W    move into Q_induct3
- T+ R& K7 {% _) s    move into pickaisle.induct3
! \! a/ C  i$ S8 {* a    while A_i<=30 do begin
, D# ~; v/ s$ E# u. p, r1 l        travel to pickaisle.con(A_i)
. _& x8 n) e' f; c( t. `  a( G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* v3 q1 X* ?. g
        else wait for 10 sec
* a) X" V7 a* }! b) T+ X# i% _        if A_i=A_leave then send to die
3 j) p3 ^' ]* |3 @8 I8 R" P( g        else inc A_i by 1) E, n1 P" h, F
    end
/ s. s2 ^% b, \# U8 Lend

最佳答案

查看完整内容

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是个什么东东?5 c0 M1 i/ T' d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ D, ]/ s! C4 m+ r' O2 E
/ S0 r7 z6 D7 z( A4 `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) v$ W& X2 v, }1 [9 Q) G
8 U7 r9 F2 _: E* n$ S8 A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, J1 \4 n5 Z5 e4 G: ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) d' s7 ]1 |" W6 A+ b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 Z0 R6 ?$ Y- j: n: n6 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  D4 O: Q' p1 B4 f3 l
begin P_induction arriving
' E4 r% c) F' J) p    clone 1 load to P_pick(A_induct)
6 m, Z* ^& D7 n8 e2 j) A- ^5 ?9 dend最大的系
" L: k/ r0 w9 }9 H% o
1 g1 d6 {# P% e) v& M8 G, cbegin P_pick arriving
! c0 d  d( p* J; X    set A_i to procindex * 10 + 1% h9 z$ M$ @; m5 R( I* |
    move into Q_induct(procindex): E9 H4 g2 t  e" A% R0 V
    move into pickaisle.induct(procindex)/ F, s1 P( D. z' N- Z
    /*check the type of pickaisle.induct(i), for your last problem.*/
; J9 J! j6 b7 V1 H
! r& `" @+ K3 v5 J    while A_i<=30 do begin
9 }# j# @/ D# M1 U+ R3 \) k        travel to pickaisle.con(A_i)
6 v, L" @) E8 r( N/ r4 h. k8 H: u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% P; D7 b9 d  O; R
        else wait for 10 sec) a3 t- @1 c$ Z1 v
        if A_i=A_leave then send to die
! W/ W& A- ?7 d$ |! K  p" B        else inc A_i by 1
0 U' y; V6 y, C7 t" w* g6 h0 J% Z    end
* L, J/ U0 x% A8 f" l8 eend' F( R/ ^3 S( P/ F- G
+ M: E8 h1 n1 V* d2 L
其中的procindex为整形,代表当前process的序号。5 G2 t1 z& r- b# H$ X
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-1-21 08:43 , Processed in 0.213989 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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