设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13946|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 p' P* m0 `9 p& S
) j, A) e( C3 I5 g0 _/ r4 A6 a" 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中的数值,不知道会不会有什么不妥。( A/ O3 S. Y! {0 C
" A; Z7 D5 W) F! G0 d( o  |
begin P_read arriving- u6 ~( T& j3 C1 ~% m& Q
    while 1=1 do begin
( s+ j; [, C) M0 D4 U; `        read A_tote from "data.txt" with delimiter "\n"  n+ P4 j. T: g7 B
        read A_time from "data.txt" with delimiter "\n"  G# g3 v  G! l" C! g$ h
        read A_leave from "data.txt" with delimiter "\n", u1 B& o( F; @! t' y, K
        read A_picks from "data.txt" with delimiter "\n"
; T6 Z( ^: z9 ]        set load type to A_tote4 }, D* e" Y- [; w1 E6 H7 a$ Y/ w; k4 w
        if A_tote="tote 1" then set A_induct to 1
9 W/ c" y" T: r/ @: T' A$ l: O+ k        else if A_tote="tote 2" then set A_induct to 2* Y$ x/ x0 j! y. Y' Y6 k( N1 r
            else set A_induct to 3    ; C: A/ S2 g4 Z9 \/ R, u$ c+ Z, s
        set A_i to 05 A, g, q& d% O
        clone 1 load to P_induction6 U! b3 L* \9 C' b! r
        wait for A_time sec
' m& c5 ?: e9 X* e& t" D4 j* m    end7 f# L8 @* v+ j# R$ K: [
end
) e9 m- M! l3 X$ ]1 Z' R5 O
  U9 J( O) J% _4 |begin P_induction arriving$ ^' S. i% j9 `6 k* ^3 Y0 U
    if A_induct=1 then clone 1 load to P_pick1
6 ~# ]3 C  o# Z    else if A_induct=2 then clone 1 load to P_pick25 u; M8 Q* U- ^5 \3 T* _8 k" P
        else clone 1 load to P_pick34 t( t& U1 m5 W" N- C6 R3 U
end
* G8 \4 @) C/ O) \$ ]) R! d
5 ]7 \5 g2 j* O3 Mbegin P_pick1 arriving& `, X$ E; X6 X2 X- @# |
    set A_i to 1: T6 Q5 A* h5 z8 e9 O4 N
    move into Q_induct14 R; x6 `! N/ A- W" P
    move into pickaisle.induct1
0 Z- Y- |: ~, ^& T1 ]8 B    while A_i<=30 do begin
- g& I: D/ Z# Z& ?* k/ D- R/ C: d        travel to pickaisle.con(A_i)
) H; w. Q: z( i9 X4 E+ U1 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 G3 [3 J8 I3 a, j# c2 r        else wait for 10 sec
% x5 d* @/ N7 ]  f2 q/ B$ G, s        if A_i=A_leave then send to die
3 b$ Y5 S: s) Y2 N        else inc A_i by 1. E) j( s) l9 I8 ?
    end# B1 e0 Q: o2 v* ~1 i* k: P
end) x5 j* ?6 c. P6 g3 C+ E) G
* L) y, B4 D1 A7 J: }( Z
begin P_pick2 arriving+ I; f2 k" W3 g. N( j2 p( q# }
    set A_i to 11
; d5 m, V+ p9 a1 E. Z9 T1 r    move into Q_induct2
( ~# [5 O2 N- x: n. r    move into pickaisle.induct2
$ V3 ^& I8 s7 r4 \    while A_i<=30 do begin
$ K, U/ h$ g! R! t5 F9 H        travel to pickaisle.con(A_i)
0 L8 i. L# M2 x, o3 c7 Y, g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ I) d& y, I% K  J; o0 Q" E        else wait for 10 sec
" L# U9 P5 Q, e( h- Y7 R8 \/ d! E        if A_i=A_leave then send to die
. V  K% }) L4 m% T        else inc A_i by 1: k+ r0 Z6 E$ Y( ?' m6 D2 |0 G3 S+ T
    end$ [' k% M- r) B8 }- T
end
2 N4 q+ U3 d$ M5 v! h6 [6 D9 Y0 ?6 P
( Q3 z! v7 d, Z* ]. Xbegin P_pick3 arriving* R) X3 {8 f4 n# }2 b$ W/ t  Z& t
    set A_i to 21
9 z. j( G7 a$ B    move into Q_induct3
$ Z. g* }) n9 S! ?  |* P; \    move into pickaisle.induct31 ~' I  Z" }2 K
    while A_i<=30 do begin! d2 U. B9 c" F4 V' g
        travel to pickaisle.con(A_i): n8 `. ]* A% d3 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# |7 u& `/ ?( F
        else wait for 10 sec5 w" G% t1 q3 R  E' R0 m0 B" g
        if A_i=A_leave then send to die
% G$ f* ]" a+ `+ L! O, A7 \- L        else inc A_i by 1) e& K+ d) P# \2 x
    end& W( G) X1 F8 t& Y: U
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是个什么东东?. y4 J& v4 b* {& V. l, {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' C& C! @# ]" Z% j$ G/ ~$ H% h  |) G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 e0 J- O' V* E' |; Y  C; G' v# d
* E" n# a3 K2 W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% A+ O1 x* [9 ?" l  o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! h/ |! Q/ W- i! s  s5 G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 ]6 i& S5 V/ \) X( A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  U3 ^  q: m/ Q, d( F4 nbegin P_induction arriving% V. q. N: J4 Q1 \3 y0 D5 M; t
    clone 1 load to P_pick(A_induct)
) H9 v, E1 y. Uend最大的系8 `1 _! m7 S3 O8 o

7 |$ t- y0 e/ [; O, M) Z4 b* Xbegin P_pick arriving+ t: b, M- ]7 K3 f+ d1 X2 I4 J
    set A_i to procindex * 10 + 1) b5 L2 Z; a5 n; }, k5 {
    move into Q_induct(procindex)
$ v' g# s! O9 Y* l# @- K    move into pickaisle.induct(procindex)
0 x, \7 s& A" H8 g    /*check the type of pickaisle.induct(i), for your last problem.*/
' E2 `$ F5 X; J9 n: _* O5 e' `$ ~6 K) i- F+ S9 A
    while A_i<=30 do begin
  `8 b2 `$ m, ^+ k        travel to pickaisle.con(A_i)" s) _+ L+ ^+ F7 c! E- a$ }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  |, z  y4 w2 p; D/ J+ d& w
        else wait for 10 sec
5 @7 p/ \3 R8 {        if A_i=A_leave then send to die
/ I& F/ ]. m- w        else inc A_i by 1
9 f: M  \, ^- W/ `# {0 G4 j0 N" R    end
/ q7 ?! n& n: D" ^end
7 ]  ~% l3 }5 h* A7 W" }& K: l( Z3 o2 K5 N$ I
其中的procindex为整形,代表当前process的序号。
# g5 A. G* H$ f& ^7 O) B0 tstation和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-22 16:40 , Processed in 0.017208 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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