设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12523|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! h0 h$ F: L* s* l% ], ]; f% A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. w5 p, f3 I0 N7 p5 h1 ^" _5 v5 J! @. e3 i
begin P_read arriving$ L, t2 i3 Q" P, U5 R$ r9 ^' ^
    while 1=1 do begin
, j; u/ w/ Q+ I. e' T( h) _6 c        read A_tote from "data.txt" with delimiter "\n"2 k" I) W6 n# V* w2 j: k
        read A_time from "data.txt" with delimiter "\n"
2 R* o% y, Z; G6 P& k3 J5 W( I. f        read A_leave from "data.txt" with delimiter "\n": \6 s: [. O  d, ]
        read A_picks from "data.txt" with delimiter "\n"
! q5 H- T  z/ w+ Q, ?, m  l        set load type to A_tote* S2 V* _$ ~$ g
        if A_tote="tote 1" then set A_induct to 1
& W0 B3 \* g1 O3 L" D        else if A_tote="tote 2" then set A_induct to 2
$ ?# T3 w, W) j* }% B            else set A_induct to 3    6 q- w0 t8 C' w& w
        set A_i to 0
9 X; R. y3 S* c0 M5 v        clone 1 load to P_induction0 n4 ^1 j5 R# S" f- L" {
        wait for A_time sec
/ `, t3 w& x- C7 A6 N" [7 H    end3 w; V, s  ?- [7 B
end! A) P/ J: E' Z, b; T
0 V) @. V; H; ~
begin P_induction arriving5 E6 ^3 q. j3 j: z! N
    if A_induct=1 then clone 1 load to P_pick1
, N9 X5 U% Y$ Z( s8 L# G    else if A_induct=2 then clone 1 load to P_pick20 s. X! r% e; F
        else clone 1 load to P_pick3
0 M1 g; V( |# h- T) q5 jend8 F, ]  Y# ]" k& {; W% }7 ~
* e) w" S% ]- G+ d% k% X8 s1 c( |
begin P_pick1 arriving3 q1 ~+ o' \2 u9 r, [; Q8 B
    set A_i to 1
/ d3 W* g; y5 ]    move into Q_induct1
4 o5 h( w/ Y# f8 L; M    move into pickaisle.induct1' i0 M7 @9 d( ]& f4 q9 u
    while A_i<=30 do begin( ?5 c8 E1 m5 h+ `/ t$ w
        travel to pickaisle.con(A_i)1 w4 q+ ]8 _1 W8 l. a; e1 G$ R% ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ~% s7 a, d. N. X/ t
        else wait for 10 sec' `3 h, A/ @- e, \
        if A_i=A_leave then send to die! E2 `& A# K  e; C% q$ E6 \
        else inc A_i by 1
3 B1 q( q. w) e% O# q    end
& ?- i$ j/ Q9 I( y+ I' nend
+ ^) I0 A4 R  c1 X) w1 |4 C- m; t1 o, x4 J: ]) c
begin P_pick2 arriving
1 q7 K( A; u# x( D    set A_i to 11; m1 @9 [5 h. ~* u
    move into Q_induct2
9 l0 a2 `9 J. b- t4 {4 m, i6 p$ H    move into pickaisle.induct24 d/ y. `* t+ z1 r! O( {$ o
    while A_i<=30 do begin
' {" M$ {# H; @& c5 u        travel to pickaisle.con(A_i)
# S2 D/ G8 z* q, G% }( j  L7 h" h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 ^1 [4 p; `- }; a6 [  u        else wait for 10 sec5 r$ R  L* h9 [5 ^" |+ l. }
        if A_i=A_leave then send to die0 {, j& F) L0 W. O+ o
        else inc A_i by 10 E/ ]2 R( b6 {  q
    end
7 V- n, ^6 _' N9 w' yend
# ]7 I$ e* }/ j3 E; ^7 |1 X' {! @7 T
" p% Q! D1 k6 p2 Kbegin P_pick3 arriving
! I6 ~0 d0 _7 ~) ^    set A_i to 21
4 r  q. H- r# S" ~/ ]" W$ n    move into Q_induct3
% K9 W. S( o: m1 A3 ~* u    move into pickaisle.induct34 ~8 q7 B5 G4 @' A4 ^- M  @% K( r
    while A_i<=30 do begin
$ f4 ^% y! U% f6 N- u        travel to pickaisle.con(A_i)% f  L! Z3 L  L% }8 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 k8 R- N. z, d8 G1 S+ Y
        else wait for 10 sec; d# w* y+ e' S3 f' k2 l
        if A_i=A_leave then send to die
- b$ w' n" X9 ]6 u% x0 F0 a        else inc A_i by 1
& A! X2 ?( x) U$ c5 {4 p    end; ~( e# C/ t2 f. G  r) d, N
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是个什么东东?
. H. t. [; Y# k/ x  r- u" q$ hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ q/ Z& h* \- I6 Z/ g: F5 \  J9 C" _  }
# R7 @' U! F& h0 d9 fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# L6 G+ H$ A- g+ Q# o! ?8 S) A
4 a7 y# N% p' w' [- r2 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 p# g& c- r, D* D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 N# A) R4 ]/ b7 S2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 f5 I4 {/ a; L4 r' C1 p) C
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 p+ v8 E5 V' j
begin P_induction arriving/ _+ ]; \) [  p; q/ I. P1 b5 l. {
    clone 1 load to P_pick(A_induct)
/ R& C) v' S4 k! x) _end最大的系
' i" k* ?6 q3 A6 }4 M, e
! `$ d. j* Y  I& Gbegin P_pick arriving
( x  X0 x# i( U- J0 }9 L    set A_i to procindex * 10 + 1
! i  H; S0 J' d2 G) X) a    move into Q_induct(procindex)# ?: O: x/ L( \5 |9 C# j2 _
    move into pickaisle.induct(procindex)! u& I0 Q/ O! V& ^, O
    /*check the type of pickaisle.induct(i), for your last problem.*/
' U4 W5 U7 C# F; l+ P1 c( K3 J7 B. X2 e9 w+ R1 W
    while A_i<=30 do begin
, h1 p/ m( ^$ J2 o& r        travel to pickaisle.con(A_i)
' U2 U2 P. R, i. l9 Z0 w  F! w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 i6 o) [* ~3 O$ N* {- g
        else wait for 10 sec
; P/ p8 M8 ~5 m        if A_i=A_leave then send to die$ n# d1 z! y9 x, x+ p
        else inc A_i by 1& c  x) s) q! y$ o
    end& y8 q4 }% ?) S4 e/ [8 A
end( C# A  V' E' R; j5 i! u/ [2 t

+ M3 n4 `3 t* c2 D其中的procindex为整形,代表当前process的序号。9 L; J5 o& s% e. o* r+ ]0 ]- g$ l
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-29 20:46 , Processed in 0.018735 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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