设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12421|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( l0 ~4 t9 m; n9 m3 e7 ^
6 B  P8 R8 [+ J/ a& j2 @( 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中的数值,不知道会不会有什么不妥。
8 P& f7 N8 o1 |4 X/ b* p) h! v" {7 R2 Y+ S) Z8 f' b8 v
begin P_read arriving, ^. `( p- I" a2 J
    while 1=1 do begin7 m# \: M+ @# e. W
        read A_tote from "data.txt" with delimiter "\n"" P* K, W; ^3 T) A) O$ b
        read A_time from "data.txt" with delimiter "\n"6 p: i+ [% z8 v# l. H
        read A_leave from "data.txt" with delimiter "\n"
& N  J+ U1 {: M1 M8 t6 f8 o  o4 }        read A_picks from "data.txt" with delimiter "\n"
" p9 F6 K- ]- c3 L) L        set load type to A_tote
, G% n6 |4 S- V  I7 O8 Y0 h# _        if A_tote="tote 1" then set A_induct to 11 f# q+ \7 X& V& O& K$ m0 W
        else if A_tote="tote 2" then set A_induct to 2
# r; a% i8 O0 T4 w            else set A_induct to 3    ; k- U: p7 x- N2 I$ x8 B
        set A_i to 05 k/ o2 V4 S! I- R1 C4 m
        clone 1 load to P_induction
& V( F6 E  Y+ `( y* f& V- |0 ~0 N& n        wait for A_time sec
2 X& \2 O0 N' z6 |/ ]. B$ u    end% m* M- M" ~& |
end& y; W4 ~% G  O  f6 ?7 K0 M$ i
# W- _9 e# K7 V
begin P_induction arriving4 a3 m7 q! O! z1 q+ a
    if A_induct=1 then clone 1 load to P_pick1+ p- r# m; B" v/ M' Q- F
    else if A_induct=2 then clone 1 load to P_pick2
* E) j* F$ Q$ v' ~. m        else clone 1 load to P_pick3# }4 }, B0 Y4 X6 o: z, w* ~
end
# O4 Z  y5 _- M- t' j; X
# u5 {0 ~3 C" A' X! wbegin P_pick1 arriving' J: N% e& N, V
    set A_i to 1
; M4 N% A* d/ `4 g$ X    move into Q_induct1
% `0 l7 l0 N' F3 h& M8 y: P$ G, u    move into pickaisle.induct17 s7 G( U( V5 @0 n5 C
    while A_i<=30 do begin
1 j2 }9 j. {6 ~3 x        travel to pickaisle.con(A_i)
5 c8 L+ _$ w6 O0 j" T; q) w/ |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 a( H! Y8 X# F( Q6 k        else wait for 10 sec( P% A0 M5 j  L/ _# i) I
        if A_i=A_leave then send to die
4 R- ]* v: b9 n; I; {0 I        else inc A_i by 1! a/ D+ r: A7 M3 D9 _) M
    end* R9 \  g& t$ {+ P
end, z4 e% K* m( D$ w9 M

( V0 H- r/ F. Gbegin P_pick2 arriving' Z& R& S+ j% N9 ~' f
    set A_i to 115 z( F! h5 ?* k$ q
    move into Q_induct2
) C2 o. m3 n3 @$ ?+ ?7 o    move into pickaisle.induct2
# `, z$ L# z% M6 z1 M% U8 c: r    while A_i<=30 do begin+ H4 X: Q3 |0 ^' I& I2 M
        travel to pickaisle.con(A_i)4 _. D8 X+ b& ]' l# P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. {' ], W/ V, W
        else wait for 10 sec. M4 o8 R8 T, q& ?, F" C# x! v
        if A_i=A_leave then send to die% R+ l: ]' v/ f+ p6 y1 `, e
        else inc A_i by 1
) D1 D& g1 |6 N/ E7 {( I6 W    end
! N! R! K6 ?# j( j8 xend- j; {  [. z, l$ X( H' {. U, [7 u# K
" y& d/ Q: O5 J
begin P_pick3 arriving
6 g  ^! D1 H9 I6 ]" p; ]: ?* _    set A_i to 21
" o; \6 t8 m0 V    move into Q_induct39 H& f2 h1 z5 W" z* }' g' [
    move into pickaisle.induct3
  \3 f( _- R; x) @    while A_i<=30 do begin
- L7 |+ j7 x( D( W        travel to pickaisle.con(A_i)! c" M4 N7 O! a% Y  F; m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 H* F+ O8 {" m
        else wait for 10 sec
5 h- [. ?6 T/ ?2 V9 l5 O        if A_i=A_leave then send to die$ q! |4 W3 n& I; R7 R, d
        else inc A_i by 1' U  F% z+ e: J& d, \8 e
    end( Y0 f+ r9 ]! `& S
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* V) w& D6 n7 Z& c! K) o- B% Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 j7 H/ O, q/ `/ r$ b
' Q0 ^" g3 z" w; ?! S: s3 u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" h1 z& ^$ A) b  E' Q) T

$ y% V( |1 q) m, N3 M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 `$ H; \, j* v( K. d/ z  I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; Y; G0 v' l+ |0 V- k6 y2 d( r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" [# Q. f+ k) o+ q# m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  a8 Z" d( p+ i9 ^
begin P_induction arriving# V% o+ k3 K* n9 K
    clone 1 load to P_pick(A_induct); B( v' E" b) D, C7 s! Q7 H7 `
end最大的系8 D) @4 z" H$ ?9 r7 F3 H

4 V- Z5 v# Y# I. l! d6 w, ibegin P_pick arriving' J; O' i( m: j
    set A_i to procindex * 10 + 17 b8 g) l/ t" q: e5 t0 ]- Z
    move into Q_induct(procindex)
4 T6 U: T  S3 b& [) z& {/ e    move into pickaisle.induct(procindex)% x9 B0 b  G- r
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 @. a6 T' @+ F4 G# B4 O
5 j" X% X5 z# i: B0 n    while A_i<=30 do begin
5 [# e+ d; b$ _; D$ Y/ \        travel to pickaisle.con(A_i)" `+ K6 O' \4 I% q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 T1 I* O1 f( E        else wait for 10 sec, Q0 O4 l8 M3 q7 s0 q+ m, h
        if A_i=A_leave then send to die; M2 p+ G9 ], V
        else inc A_i by 1% l! B0 Z7 w+ y4 B5 {2 O
    end9 F! w! l2 W3 D% G! E& L' u
end/ R& {' K5 {) L+ L" g( j- U; X

* j+ [$ [% R& ]: L) y0 }其中的procindex为整形,代表当前process的序号。
; N  z% u% p2 J; O+ l4 _7 pstation和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-22 07:32 , Processed in 0.015410 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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