设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12124|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ I) u6 e  r2 V* z* D: [8 s
3 w+ A- m# j+ b/ 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中的数值,不知道会不会有什么不妥。- @7 c  Z7 s2 ~# e# [) B

3 c! Z( i3 S  I; j( K( m; ~5 n4 @begin P_read arriving
: s! {2 X+ R& S6 ~, v    while 1=1 do begin
: [. ?- Y9 M& ~  Q        read A_tote from "data.txt" with delimiter "\n"
5 r9 }: R; z. c5 z0 E        read A_time from "data.txt" with delimiter "\n"0 |* K2 \$ E5 R6 h- @; c2 a1 ?
        read A_leave from "data.txt" with delimiter "\n"6 D; j5 M. u& x# d0 n
        read A_picks from "data.txt" with delimiter "\n"
) {( Y  i, q: r        set load type to A_tote
; i/ P) F6 ?) r+ w" E  Q: E9 A2 |! ?        if A_tote="tote 1" then set A_induct to 1
& J, u1 j% t  l5 J5 ]+ k0 H2 Y        else if A_tote="tote 2" then set A_induct to 2
, q1 w' p+ Z  A/ Z! _            else set A_induct to 3    ; l0 P( s* z* a, i' U9 V
        set A_i to 0
: K! e# _3 J- r3 x; V! m6 V        clone 1 load to P_induction
* q# ~( a+ Z4 n        wait for A_time sec
8 M( }* N2 u6 ?6 [$ F9 l1 Z2 k2 Y2 p    end
* O" k" G1 c9 b0 ~$ L3 ]end
7 E0 Y8 l) ~6 i( m. x$ \7 \; g# {$ g3 I9 A$ t
begin P_induction arriving! n, n6 h3 q  N# j8 @3 k
    if A_induct=1 then clone 1 load to P_pick1, E$ f2 l& q$ ^! o# M3 O
    else if A_induct=2 then clone 1 load to P_pick2( z( n) P6 y' q) p8 o) K& D$ ~; P
        else clone 1 load to P_pick38 V( [$ q& X. a) T( r$ u" m2 ?% J
end
" }8 @3 _5 U( u+ R6 ]" Z: R$ n3 j& c, F: D5 R
begin P_pick1 arriving
# \. \& I) w( v    set A_i to 1
7 L' M0 |5 x) b, ?8 J    move into Q_induct1
5 |; P. y8 U  y9 m3 l    move into pickaisle.induct1
& j8 f5 a. q: t- }9 A    while A_i<=30 do begin3 q$ e5 N3 E5 u* x. K
        travel to pickaisle.con(A_i); w0 d  M* ~2 x4 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' |$ _( Q7 H6 `7 ^
        else wait for 10 sec
  A2 v7 g! L1 q5 _* T( ~        if A_i=A_leave then send to die5 @1 R/ L; z  k, N6 S2 N
        else inc A_i by 1
$ ], j$ x. |6 V/ H7 ?( E3 L    end% F4 j" v  |$ G
end( e4 T0 {! A  u% B) N2 C
+ @2 F! }. F2 J# A) @1 ?, T) D
begin P_pick2 arriving2 o7 _% D" s1 P, J7 x
    set A_i to 114 T+ M# z# ~+ v
    move into Q_induct2, Y9 o2 u8 j' u% k& ?' |2 t
    move into pickaisle.induct2$ w5 k- q! W2 e7 Y5 K' }( Y: j
    while A_i<=30 do begin
1 [+ Z; y3 z1 x5 g& Y  x8 l, Z        travel to pickaisle.con(A_i). f! c7 j3 N$ M+ f* i; h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! e$ M, i# }) z* y" X4 \7 B7 f        else wait for 10 sec
8 {5 A  z5 A! q        if A_i=A_leave then send to die  Z+ [- Q* O" j: g3 e
        else inc A_i by 1) a! L# q7 X' ]6 w
    end$ D4 J8 t) D* W1 A- A- s
end
6 v. X0 H( d7 {; [$ y0 a* S
% o3 H% V+ P$ i8 k3 j3 ^3 Ibegin P_pick3 arriving
7 q/ {3 d* M! E+ ]& D    set A_i to 21- a6 n& }: y$ \* D! d+ a6 T
    move into Q_induct3
) Z2 B* ~5 M& v, g; q    move into pickaisle.induct35 j' M3 D, T3 j4 N3 r
    while A_i<=30 do begin! N/ y4 J; A  P; a8 E
        travel to pickaisle.con(A_i): z+ b( k: d1 X5 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 |! L% N( J6 n* y: ]; _
        else wait for 10 sec
+ `5 u1 K3 D, f        if A_i=A_leave then send to die' [( M% ~6 t: r5 ^1 G# w
        else inc A_i by 1& k% c8 @5 b. Z7 I0 h# G
    end
5 u6 \) z; e: R6 i3 s7 k* h- n$ n' ?. b3 _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是个什么东东?  {3 P( s. |1 v5 k1 c: W0 t& \3 j# {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( }, Y0 Z& x- c6 f: g$ m; j# a: W
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ [" t& e' {! n1 @! T0 q
4 W% H6 U2 e* {/ \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* {$ X0 d; i: I1 V( C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% |5 d' m5 \+ r5 B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: n, G4 ]! j; p7 S7 N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 |6 e( x, e' |6 T2 I9 F- o% i+ g
begin P_induction arriving
6 t7 l. O* L  O4 ~& J    clone 1 load to P_pick(A_induct)
/ f+ ?3 `: n: V- o% G# s, Aend最大的系  i& w2 c' r9 P
. l, N* b, j0 `1 M8 o  ]  D2 m
begin P_pick arriving
5 ]% A* f$ E3 z( L8 V    set A_i to procindex * 10 + 1
/ h- u4 a- h" N4 R7 _    move into Q_induct(procindex)1 Q" A! t- F7 q3 V) |
    move into pickaisle.induct(procindex)
! ?- e+ Z  Z( W& Y7 ^- }: w) J# |    /*check the type of pickaisle.induct(i), for your last problem.*/6 X2 H' j, |0 u: M
( ^5 d) q( d1 k! H( T: b7 z' V; |
    while A_i<=30 do begin
0 W1 U5 g9 j, p; x        travel to pickaisle.con(A_i)
( k/ e! X$ V& K  L8 c) I' y$ _' \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) g* m. L6 I0 J- v, A( k) M1 q
        else wait for 10 sec4 w1 P+ r: y. K5 u( ~. l
        if A_i=A_leave then send to die
9 |( |" i8 e1 z# B+ P( L  c        else inc A_i by 1
4 C" R/ I, b4 Q5 p- s/ @) L    end$ \+ c% [% V+ p. |6 m7 P; `
end9 T8 |: D+ }: U8 V' t0 P+ L- Q
" J7 [& X0 H8 M, r
其中的procindex为整形,代表当前process的序号。* }5 x6 z; @5 q. W" j1 h5 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, 2025-12-29 15:11 , Processed in 0.012318 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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