设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14898|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 p. T- V, y. _' x

4 P' i, L, c: P# w1 ]& P我的问题是,在每个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中的数值,不知道会不会有什么不妥。! D0 P+ T) }$ S$ j9 R$ c- @& ]! @

# l; t! U- H9 _, L9 e9 u- P1 w) Cbegin P_read arriving: y" b! w4 K- V+ n( b/ `0 y6 E  m
    while 1=1 do begin0 ?( w! ^  C) u9 B9 T
        read A_tote from "data.txt" with delimiter "\n"! q$ l" q2 ]& l
        read A_time from "data.txt" with delimiter "\n"/ P: W' [$ d6 g; A8 w0 ~9 U3 T
        read A_leave from "data.txt" with delimiter "\n": g, Y: P( P/ R
        read A_picks from "data.txt" with delimiter "\n"# m7 ?/ O6 ~& L* L& j! C
        set load type to A_tote  \* W- V* U$ t7 K% S* d
        if A_tote="tote 1" then set A_induct to 1
8 Y; k4 A# {- i, ?        else if A_tote="tote 2" then set A_induct to 2$ [; A5 u5 ~9 X/ L: M  a0 u( K. L! h
            else set A_induct to 3    8 h; V* l6 h: X9 `! R/ S
        set A_i to 0' ]' D3 ?  I) C( x' C
        clone 1 load to P_induction6 w5 J9 D8 l; P8 L
        wait for A_time sec9 c  I# ^& T; f+ ?
    end
8 _4 A) ~7 L$ c! `: S9 |end
: o# @& H7 \5 W7 k. X7 S; }4 N- I3 [
( Y9 G2 u  [3 ^( b3 [1 i) @& l, Fbegin P_induction arriving
' V# T' n8 K" H4 m, F    if A_induct=1 then clone 1 load to P_pick1
. W, L. b+ f0 s5 ]    else if A_induct=2 then clone 1 load to P_pick2# t$ p2 I& |" z
        else clone 1 load to P_pick3. X7 x2 [. c! v
end
8 F0 D* R' ^( X6 F
/ q' e) D" U* }# n$ R: S$ N/ Nbegin P_pick1 arriving) [; H+ w6 [5 L0 ~, B* B1 I- S8 \
    set A_i to 1/ h: j8 ^2 Z% a5 [: ]4 {7 R$ Q' N
    move into Q_induct17 _, h8 [. `! ?4 E
    move into pickaisle.induct1% Q0 {8 G% `. h. o8 x1 V0 v
    while A_i<=30 do begin
8 H1 y& N7 E9 s# L+ k        travel to pickaisle.con(A_i)" E" K9 V7 t3 Q2 N9 z% a! X" J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X/ b, o# ?4 ^8 |5 V/ l7 w- N
        else wait for 10 sec, y8 C/ G9 _+ P. v
        if A_i=A_leave then send to die* Y6 a* G, Z% l/ i
        else inc A_i by 1
; s. l* N7 ?' h. Q. k    end! {6 ^- F2 w: {% x8 i  I. d2 M" D
end/ D1 a1 ?4 f. W' V3 b

6 g: |! |, V; lbegin P_pick2 arriving- K4 I( T% L& F) s+ Y* k
    set A_i to 114 w- G) W% D  ^9 O/ _7 ], r' B! g/ Z
    move into Q_induct2
6 n6 g5 H* L' o7 \& h" a& T# Z' }2 W    move into pickaisle.induct20 Z! R; d+ M7 E6 h0 q# u% x
    while A_i<=30 do begin' X7 e. h9 T$ I0 Q7 l
        travel to pickaisle.con(A_i)
; x2 O; X0 N/ \* v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ g: \, ^: c3 Z) @8 i$ L
        else wait for 10 sec0 X: Z% A$ ]2 d) D# N+ ]7 }
        if A_i=A_leave then send to die: b/ N% j) h3 m+ m
        else inc A_i by 14 |* ~2 {! i( T
    end
- I8 B6 x! G$ j, }/ g' ~end% W0 K" ]2 j2 |8 ^* O# B2 g  \
/ ~% S6 [) {1 t7 V+ Q. d
begin P_pick3 arriving  o+ g/ l- ?2 E% q
    set A_i to 21! F5 _/ ?4 I! P: e0 A) d
    move into Q_induct3' E  h# K& q8 }1 m5 L7 b
    move into pickaisle.induct3
+ I1 x& U- g1 w4 e" l    while A_i<=30 do begin
/ ]2 }  G; M" @( j9 t, J7 J        travel to pickaisle.con(A_i)) S' U+ F: H; C- A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Y! n$ c  c3 ?* g
        else wait for 10 sec
: ?4 `# |$ g+ W' o4 Y5 ~1 p( ]        if A_i=A_leave then send to die* `  y4 \4 w9 p( b
        else inc A_i by 1
% @9 y1 e: |1 h    end
( }) o) w! Y$ X, Dend

最佳答案

查看完整内容

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是个什么东东?
6 k' {! y! z, N1 g5 w/ wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. D9 M1 d# |7 L; O) J6 m5 J( p" c. G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; G/ i6 L% k3 m

% a# A0 `8 c$ N- ^) L$ c! h$ |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ C  n7 }5 T2 Z1 K8 [) N. b. U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ g% }, Z- L7 g7 v7 C0 r7 L- d4 d( H
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! U6 J' u+ x2 ~" }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 U7 J: q1 E3 j9 {) K
begin P_induction arriving
) ^6 I1 J  D$ X! l9 u$ w  E0 F    clone 1 load to P_pick(A_induct)8 {" \! e: U! F; ~# e# S
end最大的系
  A  W' t# c; W6 }
0 F' r' f+ \  D- y+ H6 kbegin P_pick arriving
2 X0 [7 X4 p: r$ n, J9 `    set A_i to procindex * 10 + 1
" y0 q4 z3 a3 K    move into Q_induct(procindex)
0 `8 j- R. a3 ~8 a6 Y% ?    move into pickaisle.induct(procindex)
. I9 R# {6 I" `; B  ^6 }' Z    /*check the type of pickaisle.induct(i), for your last problem.*/
( N8 L8 R8 q/ F5 K9 m
# {  ~3 P6 [; n( X2 o% }    while A_i<=30 do begin
# Q3 F* v, O2 a+ M- x        travel to pickaisle.con(A_i)0 X; q3 j5 [, P  H& c2 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- \! h4 v3 `0 p' L+ \, U
        else wait for 10 sec
; l5 r* \6 l0 E  \1 q2 Q8 T        if A_i=A_leave then send to die
$ ?8 Y2 \4 U9 Q$ D/ R        else inc A_i by 13 X% I* H1 |, [. _
    end
; j3 ]4 F' L; l3 v% P4 `end
* @. h+ y. H, q' y- e) Z
6 m4 b$ k# a* {1 B其中的procindex为整形,代表当前process的序号。7 o- f: W) [/ s' y
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-7-30 07:50 , Processed in 0.015580 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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