设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13910|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) d6 b7 ~4 o4 [( c" }
. i- R+ Y( P% J# w0 l5 X9 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, f. x' j# g) K# D

" y+ |2 l0 S% x# G2 `# _7 N+ Ubegin P_read arriving* ^/ A. X* l! t! J6 i9 |
    while 1=1 do begin
4 w3 L& o4 r) G- S        read A_tote from "data.txt" with delimiter "\n"
" W9 p, P! r$ b  z        read A_time from "data.txt" with delimiter "\n"
8 Y* o$ w6 }; b: O- a% f2 q( z: A# H        read A_leave from "data.txt" with delimiter "\n"" y+ H$ R. d1 r3 y% D6 x
        read A_picks from "data.txt" with delimiter "\n"8 G3 T( d8 u/ P% |5 S
        set load type to A_tote  n& U" u# P" @
        if A_tote="tote 1" then set A_induct to 1
! O, V  |& |2 F- l9 P4 x4 c4 B        else if A_tote="tote 2" then set A_induct to 2
- G) h. I, c4 q: T  p            else set A_induct to 3   
+ `% m* j" ], Q7 k& |- C! r# n7 Q        set A_i to 0
7 W" J) I' h8 \# e7 d. j        clone 1 load to P_induction
1 v$ B) e' t# S6 z7 H# n" \- m        wait for A_time sec
8 F( Y% F* |! j    end$ v7 p! K: S8 x0 g( F$ R
end3 y9 i; y# p. Y3 ]2 L! b; j  a

! |, c: i4 j9 ]! i. h% }$ Nbegin P_induction arriving, ]: `( e5 E' w: C* M* B* ]$ p
    if A_induct=1 then clone 1 load to P_pick14 B+ L8 _/ W, L: c$ Y( \
    else if A_induct=2 then clone 1 load to P_pick2
( C5 j+ t7 b3 w8 _        else clone 1 load to P_pick30 `6 a: L5 S3 @! t! T4 a) ^
end
. r1 m+ W" p3 V: c. v( h
% r+ v% [+ B5 V2 Y- hbegin P_pick1 arriving) \; g5 [$ A$ S! ^+ ?
    set A_i to 1, D& X% m  c, f7 {
    move into Q_induct10 x. v" Z' k: k) q' M: \: ]
    move into pickaisle.induct1
" a) _0 J: U/ g' A    while A_i<=30 do begin
. [+ U8 _. w+ w% ^) j! L9 r        travel to pickaisle.con(A_i)+ J# q! @/ p9 X2 j. Y3 d9 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* P7 c4 V+ w+ `# u) @; J
        else wait for 10 sec
! i+ e5 N& `" L8 P% F! @7 L/ ~        if A_i=A_leave then send to die
, v! c1 C8 t! z6 A+ {0 `' l        else inc A_i by 1* {' ?. b) O7 F7 t7 T% x( w
    end
5 v0 ^* b: S8 w- Z3 P* qend
3 c. g7 g! N# Y) j$ q6 I+ N4 K
" h6 s' E6 r4 R7 v$ [+ ^" pbegin P_pick2 arriving
# d+ F/ i# M( Z+ o0 x! ]    set A_i to 11( N/ T9 E' B' W# M2 i( w. B2 w
    move into Q_induct2
2 c# G4 G) K( N; t+ w6 e    move into pickaisle.induct2, `, E% t# r3 L3 [1 R$ T2 u
    while A_i<=30 do begin
4 g/ Q; R) }8 C7 D2 `        travel to pickaisle.con(A_i)
" C- s3 Q, T8 b2 M, [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 o3 \: N! u& y/ z* C& [7 j
        else wait for 10 sec
1 u7 |, d) a5 H- [5 c! h) X0 ?, U        if A_i=A_leave then send to die1 ?' o0 h5 ?/ Z+ M" [
        else inc A_i by 15 X% h5 Q; ?% Q  u( [- ?
    end- e. M" N# Q; e- k
end
5 _6 L* ^- M: Y4 r( @, H' K6 A3 J5 Z  k$ M" i, y& Z7 W
begin P_pick3 arriving
$ z. A/ P  a% B$ U    set A_i to 21
& T) }# W) S9 R8 {# i: h* L    move into Q_induct3
" f) t6 G% F1 M. I1 N" q9 W9 i    move into pickaisle.induct3$ P( O" Z: y' {, W' h) R& g
    while A_i<=30 do begin
+ L% Z1 V7 l; E$ K        travel to pickaisle.con(A_i)
' M0 w6 d3 ^/ ]! C' U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 a/ _/ u& r7 i  U; N3 H  d
        else wait for 10 sec4 Y4 \4 _) m; c6 p2 ^2 V9 r! n6 {
        if A_i=A_leave then send to die
4 q- n/ J3 E, R; Q* }1 I$ L        else inc A_i by 1: J. d. ~. V- e- H4 B6 j+ Q
    end
& O& Z, h; e1 g" g4 D; rend

最佳答案

查看完整内容

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是个什么东东?" ^; P1 x  Z' Q# c" N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 f7 E4 o# H) z5 ?9 _

' g0 p- L+ t6 j6 q2 sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. t9 M7 d/ P; `- H$ C
% ]0 u7 \9 v/ m6 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' c, c# q- ?' |1 E! j, F! _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 C1 n# C3 e8 N% @5 s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ x0 V7 P) _  o6 W9 {- w* R) _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 G' J# C1 ~! l3 `2 z* Cbegin P_induction arriving; J* A) r) V/ p" ^: h
    clone 1 load to P_pick(A_induct)+ v! s. n& J- W" G, |8 |
end最大的系
* ?) R/ Q6 |/ ]0 }. B
( ]0 }9 q/ O0 Qbegin P_pick arriving1 T' G+ J) E5 D# Y; @
    set A_i to procindex * 10 + 1- X6 C! `7 F; O1 N# Q) c6 E, g7 T  _
    move into Q_induct(procindex)
0 r/ x& M: U. P: y9 z& s( Y    move into pickaisle.induct(procindex)
  L: C# @: }! Y+ I! e' D    /*check the type of pickaisle.induct(i), for your last problem.*/7 d: t6 K2 P8 W1 d  @

, e9 ~+ U8 P) S; O" W    while A_i<=30 do begin9 C8 M4 l$ l4 _- w0 T# r$ D
        travel to pickaisle.con(A_i)
. r3 v/ g% D, F1 X" c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 X' A. j1 f$ M        else wait for 10 sec
4 M( n/ f: A6 d/ Y6 @: @        if A_i=A_leave then send to die- \, H! E. F# O% H+ N' W
        else inc A_i by 1
% h. C- ]1 f( e9 L" {    end
5 ]) u* D4 ^$ @: Q  eend4 u- Q' @) @: ?% s: X

, w4 z6 V* o7 Y' F% P其中的procindex为整形,代表当前process的序号。
9 I5 a" c* o- w9 I0 ~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-5-18 04:46 , Processed in 0.017168 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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