设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15134|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, @; v1 c% T4 p' s9 X/ I8 @) ?' b& B6 |( `% U% ?+ E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 R+ z- m4 i6 c  }& ^

% K4 E& n, l- c9 u! xbegin P_read arriving
% a3 W1 Z/ u: \0 h' k, [( X! Z2 m    while 1=1 do begin
6 H3 w6 ?( A" E! k1 ~2 H        read A_tote from "data.txt" with delimiter "\n"0 @6 {, b  S" a) O' W! L
        read A_time from "data.txt" with delimiter "\n"
3 z! X0 C6 ?$ R0 H. b6 L        read A_leave from "data.txt" with delimiter "\n"! ?4 r& d* V3 w3 w/ @
        read A_picks from "data.txt" with delimiter "\n"# D8 R9 y' o: k8 {) W) t
        set load type to A_tote8 o' @& r* r0 p# M
        if A_tote="tote 1" then set A_induct to 1" S. z, z) q' Q) y; v! L
        else if A_tote="tote 2" then set A_induct to 2+ b- K. {6 ]& I/ s* z- D
            else set A_induct to 3   
5 s* O0 a- O1 @: X. ]' X2 D        set A_i to 0& t- }7 u  m) |0 e
        clone 1 load to P_induction- @& Y/ ~; X* @( W$ E
        wait for A_time sec# |: Q1 J; g- G3 a
    end# ?7 v9 {9 j: x3 v  d, `
end
  M: G  `2 |* H- y% n: D7 E( y' A
) O& q" j4 K1 cbegin P_induction arriving- R6 ~: n: K: p3 F; q
    if A_induct=1 then clone 1 load to P_pick1
/ f, K! U0 ^9 x9 {% _) G    else if A_induct=2 then clone 1 load to P_pick2
( s0 y& R: X2 p' {9 B) q        else clone 1 load to P_pick3
' g* W* p8 `# |+ I  h& \# Yend
8 J( e, w) A9 n% j) x% p/ @" L
begin P_pick1 arriving
- ]3 J' w2 F7 X! h7 n    set A_i to 1& V5 s' q6 \* i' L' D# d* n4 O/ S
    move into Q_induct1
6 K, v2 J/ l4 V8 h( Q6 m    move into pickaisle.induct1
7 b" }  P2 U0 o) |  m- d" s    while A_i<=30 do begin
; R, k* ^- r5 G6 t8 w        travel to pickaisle.con(A_i)
+ v, d; S& u# W. M2 [( }( i7 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  P) y/ Q( L# E% L        else wait for 10 sec
, u/ h5 {, S0 _* c# ^! J, \6 Z        if A_i=A_leave then send to die- ?2 }& @; ]  K4 M7 S; r, c
        else inc A_i by 1- Q; M* p$ E$ L: O7 z' T3 ?
    end
/ f" F$ Q7 @. G' lend, ~8 M9 J. q& C& Z1 f

" k9 @9 ?% |7 y5 C  X- k0 {begin P_pick2 arriving
' h$ v  J' _8 _; L: b    set A_i to 11
5 K. Y; R) J6 Y- W    move into Q_induct2
) c* l4 v! Y% ?  f    move into pickaisle.induct2
. g. J3 e4 I! w% ?! b! ^    while A_i<=30 do begin3 p6 \1 Q# h) o/ o
        travel to pickaisle.con(A_i)+ A8 I+ n7 L+ E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* l( a4 L& q$ E) K; h5 c; }* E        else wait for 10 sec
! G1 |: V( C: v0 c        if A_i=A_leave then send to die+ [* `- h; P7 N  z; ]( w$ f0 m& ?6 L: q5 Z
        else inc A_i by 1' {2 K# R  s5 R- w8 R  ]# s. G2 Q1 _
    end
) V7 _/ O/ n$ L1 M. \" Oend. h3 ^1 r+ Y( C# \6 z0 u" Y

" u" y. q, f( T% W( D7 o) |begin P_pick3 arriving
8 I# f2 b. q8 N, Q; f    set A_i to 21
& ?" w) s$ D/ G    move into Q_induct37 m- b+ ]$ s$ W6 s. P* `
    move into pickaisle.induct3
/ e1 g8 L. Y% i. K    while A_i<=30 do begin' ]1 X9 N$ W8 ?7 B& t! ?
        travel to pickaisle.con(A_i)6 N5 {, h" q1 T# m7 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ~" c: N% G/ a, d4 f
        else wait for 10 sec
0 q; g  h5 L: f2 P        if A_i=A_leave then send to die
5 P( ?1 i7 z" a9 B        else inc A_i by 1
' F  Q! D: \" k    end
6 ?( `6 y! p# jend

最佳答案

查看完整内容

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是个什么东东?+ b+ b2 p* b6 P7 t; E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' N2 a& b" T- w6 t# c# o8 d
( Y: b8 I- }, g: q0 LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, t: f. }% G' V6 m% }
: f$ J$ I% b3 ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 v0 u  R; k) I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 S% G" ^% a! A% S; ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- B) {6 P. S7 x( a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  f5 n: Q5 L" C. s/ O
begin P_induction arriving
4 x# y. `* w, j  Y( `& E1 s  K    clone 1 load to P_pick(A_induct)
& q6 _6 {% i6 w! B$ Z: ]end最大的系
4 h, g2 k4 W$ Y  C: P2 Y
5 h  V: M# p2 ebegin P_pick arriving
% _1 I/ T3 g; ~8 u    set A_i to procindex * 10 + 1
1 ], C1 N' B  u5 \6 N. t% u    move into Q_induct(procindex)0 g/ e5 \# A+ h5 A: P9 K# @
    move into pickaisle.induct(procindex)6 ]4 k# \) t8 a, ~
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 [8 e' e$ u. R# T# `4 o) i
- C( X; ?4 R+ q) U) t! ]    while A_i<=30 do begin! Y% n4 K6 p! U5 u9 A# G5 w
        travel to pickaisle.con(A_i)
! {$ ~; l( i' f2 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# r  J* b3 c( \6 j2 {, B8 x5 t: N        else wait for 10 sec
) \) ^% x, O* h/ {7 [        if A_i=A_leave then send to die5 A1 o% v6 Y; [
        else inc A_i by 1
2 {- g# c- ]5 C9 @1 ^    end
4 s: t4 p3 e, }; C" N: Q1 yend1 L' @9 P( x( ?4 g

& N: X. y' h; P3 P其中的procindex为整形,代表当前process的序号。
: p* L- D6 j$ q$ s3 nstation和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-8-13 17:45 , Processed in 0.016118 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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