设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12354|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 M4 W7 X0 s9 n3 l$ G1 c) P1 F

+ ]1 N! n: Y! n, D) W我的问题是,在每个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中的数值,不知道会不会有什么不妥。  |, g7 N' [% w; k( D3 m8 P% i+ o
  j0 d% B  V- ^: c. a6 p
begin P_read arriving9 ]0 y+ ]7 E' n4 F
    while 1=1 do begin* S) r8 F: W/ {6 u
        read A_tote from "data.txt" with delimiter "\n"
, Q: T7 L3 v- u' r        read A_time from "data.txt" with delimiter "\n"0 n* o( G6 |$ L
        read A_leave from "data.txt" with delimiter "\n"
9 ~0 I( t$ e8 h1 \' v6 K        read A_picks from "data.txt" with delimiter "\n"
0 r. d$ t2 @2 `) V. c% J( I" g        set load type to A_tote' ?$ K9 t: c* P+ k0 |
        if A_tote="tote 1" then set A_induct to 1
( O  K+ s' D1 d! {( u+ I) O4 N        else if A_tote="tote 2" then set A_induct to 2
2 Z- E  V6 N; L. z0 k            else set A_induct to 3    " u8 J8 @/ b+ W1 [) j
        set A_i to 0) Q8 K; N3 l4 I. J" ?$ E" ~
        clone 1 load to P_induction
* P: H/ x% F" P9 F2 y        wait for A_time sec
5 i7 v8 ~2 Q( w7 h2 h. ?    end
2 r1 I* {4 @) _5 Jend. Q, x. {8 H# a
5 l% k/ ~1 B! H5 s. e6 c% I- d; {
begin P_induction arriving# X/ o/ @+ J/ F6 d. o0 }) m
    if A_induct=1 then clone 1 load to P_pick1
4 _$ h+ |4 \' o+ p8 w3 b" g    else if A_induct=2 then clone 1 load to P_pick2
7 n( p5 L  E3 N6 w        else clone 1 load to P_pick37 \9 _) v$ X! L2 o1 s$ l, U
end5 m: I! g6 f5 N# A

* Z: U5 q, l3 O$ ]begin P_pick1 arriving
* F. U9 n" c/ d7 x    set A_i to 1
7 [/ _$ v5 j8 \3 ^    move into Q_induct1' G4 p# D0 S  A, s
    move into pickaisle.induct14 }+ E* p' B, X7 c; e$ f- _
    while A_i<=30 do begin
) i) Q0 \4 }; L) Y+ B' r6 @. l3 z        travel to pickaisle.con(A_i)* V6 @4 G+ E: [- l) j( G2 F4 K2 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# v2 V! \7 O3 a" a# ^9 S3 ^3 C# d        else wait for 10 sec
, }4 T0 \# C. |% ]0 }        if A_i=A_leave then send to die% t+ A  m  k& F1 ?/ S5 }6 r
        else inc A_i by 1
7 d  m" e- g2 X; s' B' B4 c    end. T" T' c, W& t: C
end4 X; n1 @' _7 H4 s* q, M

- E' k7 @- d& Q  X) Zbegin P_pick2 arriving
# Q7 ]- _8 B. B% a8 O9 e" V    set A_i to 11
& h; ~( t. p6 _/ n6 {  V    move into Q_induct20 P$ u9 ~  |& ~# U& q) K# r
    move into pickaisle.induct29 C' ]. m. A# @) i; r
    while A_i<=30 do begin5 W* O3 W% \; p* q8 Y* d5 {
        travel to pickaisle.con(A_i)
6 I& V2 ~6 U, z8 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' A# T/ L7 s9 S5 R9 g) G( a* Y        else wait for 10 sec
+ H8 z! \/ Q! S7 \; G        if A_i=A_leave then send to die
5 g$ s* D. @$ W4 W) h        else inc A_i by 1, }. J4 c/ ]/ ?. I" ?
    end/ p. l. j$ f# o1 G1 _8 i
end: @: q% C, d& Q) ]! o6 E
6 ^( ~! J5 ]# g( w& w- V
begin P_pick3 arriving1 T1 R) q' K8 x# N4 r
    set A_i to 21
4 S! S6 c" b" Q% Q2 o    move into Q_induct33 v" f7 W9 p3 P2 ?
    move into pickaisle.induct3
4 R  M6 _3 V# C* T$ r+ J! b- X0 l1 q& }    while A_i<=30 do begin0 J. s- ^- W- _8 ]
        travel to pickaisle.con(A_i)! I! K3 J: o. Q" [! G1 r; [; h. v3 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 O6 [8 H$ D0 [6 A( ]( e  H        else wait for 10 sec
' V: Y$ H4 T$ ^- A        if A_i=A_leave then send to die" H; H4 |" u7 u& R5 a. `& d
        else inc A_i by 15 R6 _8 N& l* l0 w8 Y
    end" F3 f5 \( [+ N2 O0 K
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是个什么东东?. A1 E/ [2 R3 O; t; V2 T+ {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' d# s" X+ Z! U9 `8 Z! N4 J8 M" x9 \% h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; `% R4 N- D' H) d" Y
6 G$ z$ d5 e5 m* D  O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" i- T- ^) v% e+ C. i) T# P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, M/ q8 l, R% q) R3 o- s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: b1 s( q1 B. _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. j( M6 V, H/ T. W0 M9 l3 c/ dbegin P_induction arriving
3 f& t5 O6 J. F: B9 ^) i) \1 C    clone 1 load to P_pick(A_induct)) j  \9 `! F5 L# j7 ?" Y
end最大的系- m4 s. l0 ?- c0 z* N7 q. P! y% ]
/ Q8 C) B- Y, F
begin P_pick arriving: H0 @) i2 z. ^: d
    set A_i to procindex * 10 + 1* k. o( L; V4 u5 o1 B( o
    move into Q_induct(procindex)
' c/ U2 w7 q$ b9 F    move into pickaisle.induct(procindex)' M; i6 m7 S  v; Q1 v! |
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ w7 V! A2 o  _' O# j& N- b
; j, Q6 X2 ]( C    while A_i<=30 do begin& K1 C+ q+ H' @( W  p' M4 O
        travel to pickaisle.con(A_i)
+ ?( z) e) t' O. a2 l/ G5 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ y) U9 w) p$ J/ y
        else wait for 10 sec8 W# ]$ z+ [5 l' ^
        if A_i=A_leave then send to die
9 Y: b4 L! X- N, U" w+ v; @        else inc A_i by 1# u. ]1 [; Z9 a1 e$ y( f7 {. N* |
    end
9 [) a0 Q# p& \/ S+ {! \end
' ^3 y, [, c% z. i% u- W; g) V1 E. |3 g' Z3 M) o
其中的procindex为整形,代表当前process的序号。
0 H2 o5 f6 p& }4 d  p: T6 v+ Vstation和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-17 13:18 , Processed in 0.016935 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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