设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14305|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* A" X0 W" y( I5 J& h
- u3 C& |! \# c* X; n9 B我的问题是,在每个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中的数值,不知道会不会有什么不妥。& G, R6 h& o0 m

! e" w1 B- o; W% ^1 @/ ebegin P_read arriving. e, p7 ~+ O+ L
    while 1=1 do begin
7 e& Z; |2 [7 S$ j        read A_tote from "data.txt" with delimiter "\n"
3 Q: r- l6 N6 U$ M        read A_time from "data.txt" with delimiter "\n"
, Z5 f/ O/ L" o, V( U        read A_leave from "data.txt" with delimiter "\n"4 S$ W  c: M7 W. @
        read A_picks from "data.txt" with delimiter "\n"
. g% ^2 X, |; L/ J5 _2 a( j        set load type to A_tote9 H" }% q* C  u; C4 [: u, |6 u
        if A_tote="tote 1" then set A_induct to 1( g- G6 }" z3 E5 Y1 T" ~( X
        else if A_tote="tote 2" then set A_induct to 2$ H$ n: F0 x( P9 \1 E4 F
            else set A_induct to 3   
) }; i7 ~( j6 {        set A_i to 0: Y) h9 H# z$ T# G* E8 W6 W" H
        clone 1 load to P_induction, |  \( N5 t4 ?% x7 t/ w4 o0 i
        wait for A_time sec
1 [  g; p) J& O" b/ g    end
0 `' u! M2 q/ vend
1 P5 t( L  A. F
2 |8 ^+ T3 T% t$ [: `" pbegin P_induction arriving- x9 {! X5 J: v8 a3 e
    if A_induct=1 then clone 1 load to P_pick1
' P! w# f; g: C2 ~; _    else if A_induct=2 then clone 1 load to P_pick2  U/ z1 o, G2 x& q- [" E9 s! _% e
        else clone 1 load to P_pick3
/ T3 N$ y, h. q8 W, ]% zend
* P2 A& T8 `( i% T. W( }2 L- r. ~' [9 b+ e$ f
begin P_pick1 arriving. ^" o9 P- i0 {) L4 M
    set A_i to 1) `: p$ {" m6 Y- H* T: O" Q
    move into Q_induct1
, M! C  U; i7 R8 @' v    move into pickaisle.induct1
2 |3 J5 J0 v% K2 V3 w    while A_i<=30 do begin
3 c5 h1 l* }5 ~  K5 H        travel to pickaisle.con(A_i). B# f: O3 }- u: [1 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ?3 Y6 W+ e: n/ ~5 Y/ Z        else wait for 10 sec
  _5 \! M' J' A5 V8 d" s        if A_i=A_leave then send to die
1 l9 ^% _( j+ E* x+ F! b) O3 V        else inc A_i by 1
# ?; T( w: ^- `8 _    end
0 l# s' |* _: t. e1 l3 q6 Nend: P4 M4 ]$ Z* n# h/ @

" t$ c  b# {9 M2 N  h4 r2 rbegin P_pick2 arriving
2 @' w1 _! T$ [& B    set A_i to 11
* }! Y- H' F! _* q    move into Q_induct2
/ w0 W5 g  L  n6 g0 @  c    move into pickaisle.induct2
4 {8 m( V/ h$ ?, k, `1 Y    while A_i<=30 do begin$ v. S# K: W. c6 b5 _  _3 n7 k
        travel to pickaisle.con(A_i)* L; u, x! D, {. V; W) s* J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 I; ~0 l) `$ ], M3 M3 w
        else wait for 10 sec+ ?& R; b' Q; S1 o5 i% ^
        if A_i=A_leave then send to die! I+ ^; ]! i9 L; J$ u
        else inc A_i by 1% S2 E- b( Q9 \3 d) b+ u7 Y( R/ ?' i% V
    end
' s; l+ f) g2 M, S3 x6 r" Gend
, F7 }, z; j1 @0 A4 N& n( I$ L  `2 T; i* Y% V
begin P_pick3 arriving
/ `" a& t% c" q2 }! x" i2 T    set A_i to 21
/ N9 _0 Q2 _# F6 V' U! N3 a) h* f* C    move into Q_induct3
  R. D% h2 X! t' ]( D/ \    move into pickaisle.induct3
/ v: P) h8 x. V+ v! a. R- q4 t- M    while A_i<=30 do begin
& M0 m7 T. s0 z1 a; [9 ~# q        travel to pickaisle.con(A_i)( x: V: Y, Z- U8 i+ |# v* s9 W2 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G# \2 z1 ?. X& E8 H9 v2 F
        else wait for 10 sec
' r" z7 f7 S$ Q2 _        if A_i=A_leave then send to die+ ^) ?' j# ^/ n
        else inc A_i by 1
3 h! ^" s6 D1 H4 x# s& C, @( U; E" s    end
' D" |4 B! R$ u+ i2 f+ ]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是个什么东东?% L. _+ K2 G2 T9 @& }1 o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( o% a1 @9 i' V* _5 @+ d3 B0 p
. y0 b! a! F) \! O; l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  U. f+ |: P& [+ e
, z9 W. V! X- Q3 d7 ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: J# v! h; }4 w6 m5 h8 ]8 f. q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- Y. O- J0 r& {! M7 Y! q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" @2 N& T1 U1 e0 N* s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& y( z6 `' {1 @* ]( J
begin P_induction arriving
% R* ?! B9 T/ ]  U- B    clone 1 load to P_pick(A_induct)3 M$ P7 a3 h/ \. s* O: x: R- \0 X
end最大的系# }3 V, n3 a/ y  B4 C- m" @6 [

$ T) c* G0 S' I# J. r6 p! cbegin P_pick arriving6 e' c: v. P9 b: s4 L" u
    set A_i to procindex * 10 + 14 r: a1 T: T: @" c
    move into Q_induct(procindex)
7 U, j. `7 e. ~1 M4 d' A& w    move into pickaisle.induct(procindex)# `5 @- r- j, m  q* F
    /*check the type of pickaisle.induct(i), for your last problem.*/9 l0 g4 ?4 i( F2 d" g

8 L7 O7 r  ?1 N! ~: }; K# Y. R    while A_i<=30 do begin9 e  H8 n( s" W8 O' f
        travel to pickaisle.con(A_i)
1 I/ A2 j& w5 V1 A* m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ L" V2 z' ~+ V/ M% _+ u$ C/ O
        else wait for 10 sec
* x! M- y6 E, }, ?; P3 O1 i; e3 p, `        if A_i=A_leave then send to die
; ~* A, g. H) U        else inc A_i by 1  \0 `$ @& r* x2 p/ P
    end
% v" E- w- o5 qend$ M) j9 k( J4 P7 w: {% f3 j  ?

7 ^- t* h, m, h/ ?0 S  `5 S7 y/ p其中的procindex为整形,代表当前process的序号。7 I& c) W9 n# w
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-30 21:06 , Processed in 0.017392 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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