设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11775|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- \/ L( X; z& b: z+ X
2 W% U0 C0 w" K我的问题是,在每个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中的数值,不知道会不会有什么不妥。: B% @% D4 Q( R2 N8 `; B

& m5 w- A# j2 k. ~8 ?7 Q3 _0 rbegin P_read arriving
0 F$ L6 M3 ]0 j/ z    while 1=1 do begin# S; e( ~4 j) s% l/ F% N% t) B
        read A_tote from "data.txt" with delimiter "\n"
/ x- J; _0 B( i5 w2 J1 p* l        read A_time from "data.txt" with delimiter "\n"
+ _' {4 n/ L/ C2 ^/ L4 O        read A_leave from "data.txt" with delimiter "\n"
2 n. g- x) K0 m3 X, H& u' U: F        read A_picks from "data.txt" with delimiter "\n"
/ K* g" J5 v  O1 K; A& X8 y        set load type to A_tote  X& Y. Y8 A2 R5 ]
        if A_tote="tote 1" then set A_induct to 1
. j% p9 j' M: B0 T9 Y        else if A_tote="tote 2" then set A_induct to 2' `9 k% A$ Z3 z+ R$ }: E  d" ]
            else set A_induct to 3   
, e! J/ J9 ^+ p        set A_i to 07 S( l- G$ e, Z$ t+ y: b
        clone 1 load to P_induction
9 ^5 S% u: q$ g  q( w        wait for A_time sec2 A2 H: L; R4 O1 m6 \7 [
    end
5 h7 ^. t% x2 f' }& Pend5 T' \5 L" I, z
" i* ~: y; O. D; J; A
begin P_induction arriving
! h& w/ P7 z3 w1 ?    if A_induct=1 then clone 1 load to P_pick1
! t. I1 K$ I1 P" {  w/ V    else if A_induct=2 then clone 1 load to P_pick2/ i0 H+ Q) ?5 f6 s: `; D( f
        else clone 1 load to P_pick3
; v2 s# ]/ j, r9 O9 Nend# l1 G" G; c/ g+ C
& ]/ s5 X) U# w" K$ y1 b
begin P_pick1 arriving8 c3 z5 l3 r" q& M) F! z; L9 W  O
    set A_i to 1
4 f  Y9 g1 l  ^3 V    move into Q_induct1! Q% x8 l, w" @% j
    move into pickaisle.induct1, H$ u1 |9 W# ^4 c
    while A_i<=30 do begin
8 `, J, }- n& p3 S3 B        travel to pickaisle.con(A_i)+ {- [3 k( X0 F* O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, _: R9 S) f0 j# D9 V2 m; L
        else wait for 10 sec
" F' z2 Y. ~# ~0 `8 U4 n        if A_i=A_leave then send to die
% _7 w! w7 w% \        else inc A_i by 13 Q; d. ^3 x$ N1 G/ W5 z
    end( g+ Y4 D2 d! M! I% ?( l
end" {: M5 O4 e0 l" v( \1 ]4 z
/ _$ P8 Y6 K9 I9 G2 q
begin P_pick2 arriving
1 J6 I6 }9 G' a& Z' g7 y    set A_i to 116 i! s. R# u0 x! W
    move into Q_induct2
8 g9 t- Z) F- f7 Y3 J% Q; r& b, v    move into pickaisle.induct24 e. W0 r! e$ x3 H% D/ A" p
    while A_i<=30 do begin
4 w& D2 r3 _( c! a; L        travel to pickaisle.con(A_i)7 C$ ]1 h8 J6 _2 K( F9 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 T( [% z* v4 ]        else wait for 10 sec
4 q* n: `9 }5 ~8 V1 W8 O4 D        if A_i=A_leave then send to die
( a7 @( `1 Q/ P  v        else inc A_i by 1: A0 K- ?* D" t: z# D; g. ?
    end% h3 }5 `+ _5 X0 a
end
- Z% y. ]- A8 I: S
* C( G# V$ ^7 O3 Bbegin P_pick3 arriving; i  r3 y9 f, R8 Y$ b, D* z6 b
    set A_i to 213 ^; Q' x1 y$ M- g8 I6 Z& m- y+ @  w
    move into Q_induct3
% ]! Y" L1 M: R# }* }8 p% @3 v    move into pickaisle.induct38 H$ u5 E8 q& v. r1 V9 B" ~
    while A_i<=30 do begin, y$ \' @1 E8 i: V
        travel to pickaisle.con(A_i); \5 N+ h  y* ~6 U- L1 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 u% T( z- e& e. u: M        else wait for 10 sec
* C% r5 f: J2 R; @0 j9 k        if A_i=A_leave then send to die
* N; l( q+ @% p3 ]0 v7 `        else inc A_i by 1! p# r7 l! W6 z: e8 }
    end* Q% M* R3 K4 s. R. @0 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是个什么东东?" b# T, `8 B% M# s( o$ z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, q' Y5 T3 B) G+ _. q* Y! \' E

; A; O) P9 \: \' p* LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( y- O) s% ?, J1 x. t9 X
/ G4 d% ?4 {5 I. `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 S; y# b/ g# I4 S6 _3 D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 h# u, B2 D& M0 D+ q$ K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: N8 a2 c: P/ }7 i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 h% r$ N: v* ~begin P_induction arriving* h* W# E- _! q" j* M
    clone 1 load to P_pick(A_induct)- h$ e3 }) G+ V. y1 ~
end最大的系
; q; u0 z  b; k: {
1 ], z6 U$ j0 e; U& R9 xbegin P_pick arriving) O% f4 x2 X$ U# N- D" l
    set A_i to procindex * 10 + 18 s6 F7 J& M" i& R  ?+ R
    move into Q_induct(procindex)8 w) m3 l4 j# k) e
    move into pickaisle.induct(procindex)
0 ]  T, d( {9 M- V% N! Q; b    /*check the type of pickaisle.induct(i), for your last problem.*/
4 g* q9 v2 U4 y
; y8 J: s7 Z7 n2 z  Z    while A_i<=30 do begin4 b7 J' E& \+ [0 `0 q
        travel to pickaisle.con(A_i)
. J0 L; O+ Q: W9 B+ _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& m/ _( c& F9 s9 n. ]% C. Z
        else wait for 10 sec
4 V7 D2 r& a" ^5 m4 r1 M: u        if A_i=A_leave then send to die8 S' {; |2 x9 }
        else inc A_i by 1! ~' E( B: u" u' I% C
    end! p+ j1 M* [/ `) X: \5 }8 I
end
/ I: a& C9 l, u+ L$ |
5 w. a" h: D# g4 @其中的procindex为整形,代表当前process的序号。
0 p/ l- {. |' R: X6 y2 F$ fstation和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, 2025-12-3 21:08 , Processed in 0.018362 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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