设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15168|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 u# [" d" x; z, Z  X( K* _
+ t& ^4 \, B1 M) t4 r8 s( F我的问题是,在每个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中的数值,不知道会不会有什么不妥。& |. c$ V- B$ |) j4 a0 i

& m7 ~* }( I! ^; vbegin P_read arriving: E' \' x( O9 X. G, c2 M
    while 1=1 do begin
9 _# t5 T) ~# C7 c" Y        read A_tote from "data.txt" with delimiter "\n"
; s- N- }1 W& a# a, b' F5 \8 Y0 B" _        read A_time from "data.txt" with delimiter "\n"' I" f4 P% T! o. t& c! ^
        read A_leave from "data.txt" with delimiter "\n"& n6 f0 N2 S6 H* S+ m2 e  w6 F0 x
        read A_picks from "data.txt" with delimiter "\n"( H  ^. `; l7 g. A% l) b
        set load type to A_tote$ c9 {' e% r3 N# \* ~! j
        if A_tote="tote 1" then set A_induct to 1
7 K9 j% {" k* Y        else if A_tote="tote 2" then set A_induct to 25 @1 F) n% x4 [9 D( ?
            else set A_induct to 3   
( q) X- E$ W3 h. s, Z        set A_i to 0
: q) g5 N; V7 l* C. v        clone 1 load to P_induction# P, q9 Q0 J# d0 d" l2 @& a
        wait for A_time sec! u2 l* k# p- |$ p- {
    end' I1 y1 |. s5 o" {* k' x
end( m2 O( P6 v! a1 Q( r3 w

- i( s" v+ q7 L; |  A  Sbegin P_induction arriving, i' ^, q5 j2 {0 O4 T- s) b6 C
    if A_induct=1 then clone 1 load to P_pick1
) t( k) {" c4 ]    else if A_induct=2 then clone 1 load to P_pick2
# X1 i  V  G1 n& [" Z4 q& R' q        else clone 1 load to P_pick3
# }- q& d# l! `# N& v7 J! ?end
. f1 m' ~, n: b0 L
# c" C" a# a' C. r& w9 g2 ]9 [+ B2 Ybegin P_pick1 arriving3 L! s% |8 o% m6 \2 ]% W9 _8 G: w
    set A_i to 1. ~3 w6 W1 s. e; Z
    move into Q_induct15 R" ~9 T8 U3 M7 v" b
    move into pickaisle.induct11 M. W$ R" y8 G5 B* M- N4 F' I
    while A_i<=30 do begin% K) `* A8 b; W, ]
        travel to pickaisle.con(A_i), z/ A" d1 b% u3 X$ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]9 v- _4 R5 s0 o- ?2 I! T        else wait for 10 sec1 M5 K' l2 r9 X. L% g8 D, K
        if A_i=A_leave then send to die
) ~6 f; e% D: g        else inc A_i by 1
% w2 m' Y  W" \7 U0 p6 g4 p    end/ o+ w: t. A0 Z) W
end4 V/ ~, l5 n- z0 B
5 N# o% k( ]- T  a" {; a
begin P_pick2 arriving- _  e0 h1 L& D- P! R
    set A_i to 11
! i$ t* d; O  N' i- `+ @    move into Q_induct2
- n$ V2 l  v% e( R) ]    move into pickaisle.induct2
# a4 a) [* a3 q    while A_i<=30 do begin' ^  J8 s/ J6 x7 B  ~
        travel to pickaisle.con(A_i)7 u0 H, W# g& f1 T/ ^) f' T5 }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ]! P6 _# l. _        else wait for 10 sec' S! e, p7 v% l, h4 E
        if A_i=A_leave then send to die7 x) n7 \2 l! Z7 ?
        else inc A_i by 1
2 a- e  N  `: O  O    end$ j1 {7 ]7 a9 k/ t0 f
end
2 t9 r5 r/ X0 G1 p! s5 G5 M, R
! t  f/ u" F3 @begin P_pick3 arriving6 F' c+ H: F2 P! |
    set A_i to 21
$ K# ?2 H# j# I# \$ ?; z    move into Q_induct32 T0 E) j5 ]7 `* D
    move into pickaisle.induct3
# O5 R  y# j3 q9 w    while A_i<=30 do begin
& Y' {6 Y) P" H4 }        travel to pickaisle.con(A_i)
! J' u* F4 Z9 I  `8 S2 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; I/ g8 z" [: u$ L$ u, W
        else wait for 10 sec
7 E; E1 q( |& v6 X. N' I2 D' E        if A_i=A_leave then send to die1 W* i$ `- ?& L  x+ ~
        else inc A_i by 16 f1 {: N: u( Q2 ~" K
    end) D; k/ p+ s- l' O. q% ~# X
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是个什么东东?
8 Q0 `% c+ m! d4 `7 b$ p# n. ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 V4 E, u9 D: t  Y; _& W

8 D/ S3 ?2 Z/ IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, r* t- i' \6 B1 F

% i4 z* b" U' r* G另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( v( K$ D  x! h9 _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 Z+ R. U- g1 f+ E, I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# m$ G1 ]+ a2 j2 M& o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ [. c2 `2 s/ D3 v3 bbegin P_induction arriving
: R$ g7 S9 i2 u1 Z, i' e; V    clone 1 load to P_pick(A_induct)
' s( ]2 @  x7 O+ v2 Cend最大的系  e, ^, M1 t7 A( z6 l9 O! j
' A9 T. v. s- G4 a( ]- b' u
begin P_pick arriving
4 v: i1 F6 x& [  o$ p* Z: O2 T% @& }' |    set A_i to procindex * 10 + 1
, Z' o3 O% a$ f: u4 L! _    move into Q_induct(procindex)
3 G! k5 ]) L3 @8 H) `" I5 d    move into pickaisle.induct(procindex)+ y" X3 |0 y* ?  R
    /*check the type of pickaisle.induct(i), for your last problem.*/+ R- x$ q6 m# s" I; `& u

+ \) k- Q3 P% D# X$ X+ z# Y" L    while A_i<=30 do begin- I7 i1 |! r% p" V% i
        travel to pickaisle.con(A_i)" n2 Q4 l8 @" j* m1 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ h' M8 i9 v" P
        else wait for 10 sec
8 ]: |- n1 _: p' z        if A_i=A_leave then send to die/ h* M: Z1 [7 t% ]. g
        else inc A_i by 1
8 B0 i- F) @; o) \) }. `    end! K, G, G+ X( t8 a/ r1 V
end
1 x, j4 q% _6 O; D' C/ D8 G
2 N! Q6 v9 O7 {3 ^5 M其中的procindex为整形,代表当前process的序号。/ F7 C! l3 ^3 q" j
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-8-19 03:19 , Processed in 0.018549 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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