设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13590|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# D; F6 e9 R0 L9 `( O" M+ K) E0 A8 P4 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; j2 y' u2 f5 @9 I9 ~

* q0 u/ a7 }6 ~begin P_read arriving$ g1 m6 W; q+ q4 O$ V* b0 G( n4 ?
    while 1=1 do begin
' J# v6 f+ k: q+ O- ~        read A_tote from "data.txt" with delimiter "\n". f# E1 |+ q0 v; r8 A
        read A_time from "data.txt" with delimiter "\n"
8 x, I$ i: ]. H4 F! g# e; d/ Y& ?- j        read A_leave from "data.txt" with delimiter "\n") C7 q8 z3 m& _: c0 t
        read A_picks from "data.txt" with delimiter "\n"0 T5 f. T8 ?7 G1 ]; W4 F: _; `5 x# P% h
        set load type to A_tote; ]# M  w! G  ~
        if A_tote="tote 1" then set A_induct to 1% Y5 n1 A# [9 O9 |1 s* |
        else if A_tote="tote 2" then set A_induct to 2
4 _9 P$ R  s; m% ?$ S            else set A_induct to 3   
+ F3 o% k8 Z. S5 K% z8 |  [( V        set A_i to 0, }( _4 U8 m3 Z
        clone 1 load to P_induction
) c/ J* C) B( P  e. o: J: Y  H        wait for A_time sec
: z" H+ V! ?  q9 _) u$ j6 E    end
: C6 \3 K: S. L& @end. ~1 q5 T! R6 D
/ @& I8 H) v; F1 X8 b
begin P_induction arriving) q2 l, w- A+ R: N
    if A_induct=1 then clone 1 load to P_pick1/ J2 \( ~3 n6 u6 X$ s
    else if A_induct=2 then clone 1 load to P_pick2
/ C5 c$ j. }* w# T1 ~, l6 q        else clone 1 load to P_pick3/ k9 Z6 }' y4 z2 N0 H
end
6 d, R$ L8 ?$ Y0 [: O5 A6 t
1 [3 n1 S2 {* \! B/ ~- ?( m! I5 Qbegin P_pick1 arriving4 p  U6 S+ }' h. H' u& F! Q& b
    set A_i to 1, d1 n; c+ y! S6 _7 b" Y2 L" u- T
    move into Q_induct1
& k  v4 p  m3 b/ R5 n3 _- s    move into pickaisle.induct1
4 t; y: C" S& h' k1 s% y; E7 E    while A_i<=30 do begin
) E( M$ `1 t& H' d3 G9 h8 J        travel to pickaisle.con(A_i)
- K4 |" |- h5 [2 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 A( K/ u* B1 s3 R' |- X3 m- q- m3 ?+ g
        else wait for 10 sec
* f2 B; S7 t1 |. s# P5 A5 w        if A_i=A_leave then send to die
) f6 d( B9 C2 m4 c  `& ?2 p# i- ?        else inc A_i by 1) H" B: l" D& i
    end
2 _9 K" ]8 a) J0 u0 _9 [end
% V9 a7 b0 f, j& a$ w% m. K& K9 e2 k7 v% b1 ^& Y% w" |
begin P_pick2 arriving
3 U3 c" y7 G$ ~  d8 ?    set A_i to 11
3 P! f9 `% Z" [. L    move into Q_induct2
. M" D* K5 z1 L& U/ y    move into pickaisle.induct29 V6 R+ H, v& ], V& _
    while A_i<=30 do begin' E; y3 G. Z- W* K
        travel to pickaisle.con(A_i)% O9 |+ X! i. x0 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; O+ i7 k+ L, t% R/ x        else wait for 10 sec
2 U: ~$ Q$ K2 Z        if A_i=A_leave then send to die$ X4 ?( M6 z3 v0 u+ A" P' w, m" i
        else inc A_i by 1" a3 D0 X1 m6 ^0 x; e
    end
5 G  w: o+ C$ k9 h- dend. I5 c+ _( w8 Q" `8 f
- {5 a% X; U* N! }$ m6 T; d
begin P_pick3 arriving' c9 ^0 ~6 @8 O6 f
    set A_i to 21& Y  y/ i& P* B% D. l4 S
    move into Q_induct3
( m8 q' P+ x+ O& M4 l; Y1 O    move into pickaisle.induct3
+ ~( _3 I; w2 I' j" I    while A_i<=30 do begin7 }$ Z' X+ U+ S$ M7 e+ ^; Q
        travel to pickaisle.con(A_i)- H. Q0 |; r2 j$ g" Y+ }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ?5 Y* U  S1 Q6 }1 j        else wait for 10 sec4 s- V( O6 ^4 i* S
        if A_i=A_leave then send to die
6 j/ \+ S$ a! ]3 d7 h% K1 P7 T        else inc A_i by 1% P: ~+ n' Z- k& e8 K1 V2 R
    end
# v, X3 @" l1 H0 K4 ]$ `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是个什么东东?
+ D) g1 g6 u0 n7 Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- D  f9 ^- N0 L( X6 P+ B
0 U4 x1 R2 M$ Q9 n; ]+ RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) A& A* q0 ~0 Z# e1 A3 F2 x# t7 N7 w: a! Y) ]2 F' a; `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 m0 k4 @  k0 ^# @8 h) A% P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% C! L- {" o  O3 \' i2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: E% ?8 W$ x: @8 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 {6 g4 L. f6 ?5 ]3 f: abegin P_induction arriving- F* y, n5 }. t
    clone 1 load to P_pick(A_induct)( [4 z+ I' f. V5 e7 m/ _
end最大的系
5 l$ |) O+ w# c: ^
( c- T# }* }4 e  K' C+ v2 ~; Ubegin P_pick arriving6 D( v/ B/ m! Z/ x' |
    set A_i to procindex * 10 + 1
( |. |  i6 N: Z: r" v    move into Q_induct(procindex)& i) k% }. O1 z. w5 r0 W% u
    move into pickaisle.induct(procindex)- t# S# c6 g2 L3 ^
    /*check the type of pickaisle.induct(i), for your last problem.*/  U/ [+ Y) z# n, \: u- D/ B

4 v+ I1 G* F8 l; a. C" U    while A_i<=30 do begin% F9 c4 D1 @. ~4 d3 z
        travel to pickaisle.con(A_i)
$ x; |; f: p' Q/ q; M, |: Q. p  [8 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: @* U3 r  \: G$ {        else wait for 10 sec
( J: x$ m0 P0 ?        if A_i=A_leave then send to die
4 d5 c8 U% G; \$ O        else inc A_i by 1
( W  [6 [) P3 I8 w* d    end
/ R' Z9 ?, C4 t0 T3 k+ j. kend$ S+ S* D& Z2 C" t9 m

# h! r* f* K/ \  r# l其中的procindex为整形,代表当前process的序号。
8 I( z, N) ]/ P9 u  A: i% s3 x9 astation和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-4-23 10:02 , Processed in 0.018857 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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