设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9627|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! s& G2 C3 a: t. W& ]; }0 U* B
) |* \) @. @; I+ u
我的问题是,在每个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% w. P! t! ^; n7 Y) [; m7 C, o3 t
begin P_read arriving
9 N/ v/ v3 G! E2 l5 }5 a8 t( V    while 1=1 do begin
* `! a) L! ~$ G6 P6 D1 Z        read A_tote from "data.txt" with delimiter "\n"
/ n0 G2 Q- }+ g        read A_time from "data.txt" with delimiter "\n"
' q1 O1 T  k/ I8 D+ `! M        read A_leave from "data.txt" with delimiter "\n"8 k5 Y4 w+ y4 P- O) z
        read A_picks from "data.txt" with delimiter "\n"
$ f" k- N5 ?; ^7 D        set load type to A_tote  k* C0 _" E9 r: K( V, d+ d# p5 h. W
        if A_tote="tote 1" then set A_induct to 1) i8 L* V" l  V$ [/ V
        else if A_tote="tote 2" then set A_induct to 2) Z9 J8 g' t! H- L
            else set A_induct to 3    1 n5 m( M' G0 C1 H1 i
        set A_i to 0
6 `4 s+ H- C- r! j7 |5 v        clone 1 load to P_induction, ^+ w- v2 F2 W' e+ i, ?/ r0 ^
        wait for A_time sec
, I9 ]/ N1 A" \* |1 |    end% t# J  r1 c# K! p
end! k0 z/ E$ Z. k( l8 n9 m

, r# o0 r$ t, K. ^- s& t! B0 k% tbegin P_induction arriving. L5 R8 \2 [1 X1 N- i) u6 L8 a
    if A_induct=1 then clone 1 load to P_pick1, H" k+ a5 p# c% s" [) o
    else if A_induct=2 then clone 1 load to P_pick2
  l. d2 L+ _2 A$ E! A        else clone 1 load to P_pick3& b9 e8 I4 F4 Z  i6 x
end
* d: Q7 q% C; G; e' S: Q7 E6 e7 G! N. Q  A
begin P_pick1 arriving! A9 u# [% \* g) O; u; |9 ]  Z9 p
    set A_i to 1- T  R* U$ @: L$ H; D! E1 j) `/ @
    move into Q_induct1
: D6 [; y* Z( f/ b! t7 a' m    move into pickaisle.induct1% ^* a0 U  _4 U4 k. Q( s
    while A_i<=30 do begin8 ]) E. `& p+ X( @) M8 W8 Q
        travel to pickaisle.con(A_i)
' S* l7 B" T2 P; a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# ^; c  X8 \: e8 z1 p
        else wait for 10 sec$ ?" o- q% c3 c4 k/ P
        if A_i=A_leave then send to die5 y" i5 d7 r  [# k6 ]
        else inc A_i by 14 B( w, d( U) E+ s$ Z' Q5 S
    end; i0 w5 m8 A% }
end
. w4 X  K/ P5 A  N& c3 K9 v6 l
" Z* i1 b  C/ L* t) W$ Gbegin P_pick2 arriving2 i; }8 C2 O5 g* S' [7 Y0 W
    set A_i to 11
! w0 i! N' Y- S  |    move into Q_induct23 I+ r  L% ?! J! w$ e
    move into pickaisle.induct24 m) O0 ~4 T2 n/ ~& c4 y+ a; _
    while A_i<=30 do begin) o* ^& l& S! [3 m% x; I
        travel to pickaisle.con(A_i)- O' z; t" P' g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ T& k8 r* R- ?" e
        else wait for 10 sec& v( W* J9 i2 F" U& d
        if A_i=A_leave then send to die
7 v8 R6 \9 h8 a  g" C+ W        else inc A_i by 1
  F# W+ X  u/ ]; ]    end  p  [/ N9 v4 u8 X7 u% d: z  E- e) B
end
8 x/ M+ p. ?4 V* u4 B) i
% y" {, G! n3 ]begin P_pick3 arriving1 X$ q3 o1 @! }! C( k* u, ?% V  X% y
    set A_i to 21& t1 Y6 j9 T, H( n3 |* \( y) X
    move into Q_induct3
1 G1 G: ~3 g+ b6 \" q0 N4 }. S    move into pickaisle.induct3  N- X2 }9 t- `/ p4 Q2 M3 W2 b
    while A_i<=30 do begin5 K% O# w& ~3 e  Q' b
        travel to pickaisle.con(A_i)
2 W5 h& E( T8 Y* J+ q% A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ f6 M# y! }+ i* N+ F6 _
        else wait for 10 sec
/ O' D2 u/ A/ ]9 n0 H        if A_i=A_leave then send to die, c! |. ~- ^" s/ m
        else inc A_i by 1
9 }7 S! j  ]& e; F2 h5 f    end' j% O1 s) t% ]9 a/ r/ u! Z
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是个什么东东?/ |! _. W6 b/ Y- e2 F4 G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 Z; Z( c; i# G8 @) l/ b" m6 a

; u7 q  `) e5 A8 p0 Y/ c$ S; zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- [) y8 ?, d/ l0 U, A
# h* O- j' H: c, N; j( X! S5 ^# H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 F9 B. X9 g9 l8 ?8 w/ e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 ^% n9 u, Z' _4 ]: _( }
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& }$ [5 {! U3 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( e0 A! L  |* L9 W7 O4 m- [6 Rbegin P_induction arriving" P( g9 M* U  c& z4 K* Y
    clone 1 load to P_pick(A_induct)
; u% m! _, n( l; ?: [end最大的系* u8 J( h1 Q% F! {, Z4 o) b+ A

$ N: L% S, s7 i' f" Y; {  Ubegin P_pick arriving
+ u4 ?$ I% F9 S3 F$ e  e6 F    set A_i to procindex * 10 + 1
- B4 @/ e) q- z, c, u    move into Q_induct(procindex)
" b# s  @( J$ i% w1 H: n; @    move into pickaisle.induct(procindex)
) @/ h- E3 y- r+ I/ K1 j" }$ y    /*check the type of pickaisle.induct(i), for your last problem.*/0 m. _6 q0 l, b

$ h3 G. A, _/ h& t6 A+ |    while A_i<=30 do begin  x( p. J$ h. ]. y: ?
        travel to pickaisle.con(A_i)
3 x( b- M2 R' E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: `6 ~' W# J6 ^- @+ b  p        else wait for 10 sec
( u, }9 Q  p" ~! D2 `) K        if A_i=A_leave then send to die" t/ p5 B" C' J$ q
        else inc A_i by 1
( n7 c+ L$ _3 M2 I& f8 {$ ^    end8 S! H- `$ q1 X' z  D1 _
end: L( ~) y. d, C9 }7 {* D& K

9 k" ?5 O% K( ?, x( U; J其中的procindex为整形,代表当前process的序号。
+ r9 o/ M$ H* F6 |5 |$ U( f- estation和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-6-17 17:29 , Processed in 0.014954 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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