设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12553|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 U" Y& ~/ S8 T6 H5 l) Y+ R* p6 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中的数值,不知道会不会有什么不妥。9 i$ {2 C9 R  f  I' K# ]  [
; q3 Z/ j; [! S" f5 G- E  m; ?3 J
begin P_read arriving$ x# \) F; J: p4 r; B# J
    while 1=1 do begin
& S- e4 h! E) r$ P( f. x3 d        read A_tote from "data.txt" with delimiter "\n"9 M4 w. Z( W* i: o
        read A_time from "data.txt" with delimiter "\n"6 w. z2 p# n1 S9 n; r
        read A_leave from "data.txt" with delimiter "\n"
+ l5 c5 N3 o8 E" H        read A_picks from "data.txt" with delimiter "\n"* |) W2 G, X# G" n* q; q
        set load type to A_tote/ l7 w$ l3 D0 {: K' u
        if A_tote="tote 1" then set A_induct to 1
: b. q( Q0 R! g+ ]; P6 U% C) U        else if A_tote="tote 2" then set A_induct to 25 P. \+ L5 ?. [, W, d
            else set A_induct to 3    * V( C! i" z7 w3 w6 `3 A: H/ h
        set A_i to 0
2 d# A/ E+ m$ u        clone 1 load to P_induction
( P8 }+ O# Y7 \# W% E: f$ @        wait for A_time sec+ w8 _! t2 H- R& P+ q( V$ `& x
    end
; Y1 q! |1 ]$ n; K! g& v$ {4 R/ Zend9 Z; Z2 @5 z3 H0 S% x5 p1 s/ c
# L6 ^7 c# L: T7 \+ J
begin P_induction arriving) \, @/ I8 \- K# @7 v: w  }- A
    if A_induct=1 then clone 1 load to P_pick1
3 z% P+ V3 H. @7 i    else if A_induct=2 then clone 1 load to P_pick2
2 Z+ T3 h0 _  ^. m' w9 _6 M/ ^        else clone 1 load to P_pick3+ j" F' K, d* Y0 K% E! v# B
end# [# m# _4 H$ N( k
' i$ U2 l% Y9 q  n* _$ O) P1 H
begin P_pick1 arriving3 Q' ^9 v+ }  A5 a
    set A_i to 1$ D6 A& g6 l- G1 G2 z* _
    move into Q_induct17 v4 M0 y: b: I
    move into pickaisle.induct13 O  ~, l& w& S  f# V2 _, C. W
    while A_i<=30 do begin$ H+ ]; e' z& N" }+ t$ B: T2 {
        travel to pickaisle.con(A_i)! }$ j! U+ w' G, d  p& c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y8 r( o+ X  }" }- I        else wait for 10 sec! A; ~  a# I& u- H! l5 X8 z
        if A_i=A_leave then send to die" f. ~$ s0 J4 h# r0 ]" g1 _
        else inc A_i by 1* X/ b7 A+ y# n$ N: C8 Q
    end1 T% R: v4 w) G! J2 w) a
end" y7 l4 k2 V8 h5 Z# j
2 f" W( I. D" Z4 ^, F3 e
begin P_pick2 arriving$ C' V0 S3 M& y2 T8 x: E$ a+ i( o# `& p
    set A_i to 11. I! w4 ?( l& [( J+ X6 p+ j7 A
    move into Q_induct2
! Q5 R+ m% ?: y5 |( W5 P    move into pickaisle.induct2
. c% g1 ~0 w2 T2 y    while A_i<=30 do begin/ u5 V- y# }  b. }5 D7 @' e
        travel to pickaisle.con(A_i); W' C/ H+ U0 A9 x0 J  |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 k' C- S; q  D2 r
        else wait for 10 sec' \1 j9 i) c3 B* _* L
        if A_i=A_leave then send to die
) A9 m6 n) R+ c        else inc A_i by 10 n9 m) D% A; _! z% R. {
    end
' X, s/ G& ?# Q9 A: ~! X# f2 R, b$ oend
- C: d4 p0 l% Z
) C! P3 m2 y9 ^, u- L- pbegin P_pick3 arriving
+ o6 _3 o; R" H    set A_i to 21
( h4 b9 g% ?4 ~! u2 P    move into Q_induct3
* ], m  R4 g9 l2 p' k$ C    move into pickaisle.induct3
8 a' `( Y) K* y% n; s* W    while A_i<=30 do begin
! S! q$ E  ~6 d        travel to pickaisle.con(A_i)
* c) {+ p0 O3 z: y, G$ P- p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 A5 G. D+ g& D, _, k        else wait for 10 sec
5 L& N; k0 A) I        if A_i=A_leave then send to die' u) q. N3 @  U2 x2 g- g% Z
        else inc A_i by 13 {6 h% K" T. J
    end* C4 v/ k+ C" h9 ]6 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是个什么东东?/ x' _$ K# S  z7 m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ _6 e, ]9 ~. ^
# d2 ?+ `# k, L6 E- j* U; cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 J" a/ K" K7 h0 x# Z, _
" u. B" K  s, t4 i  m5 T* @3 e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) p* ~! d$ ~7 B' {' k1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" y; i0 c, ~: p7 ]; w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( a( Q! `- W# Q. m# j( g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* q' ^3 B: \0 N0 T% d5 zbegin P_induction arriving
" F/ V, N" B' M! k    clone 1 load to P_pick(A_induct)
" u, G1 i, S: y7 Q0 }9 Qend最大的系
- _) I" u8 n$ D6 `0 K9 f
# i/ Y- o/ ]4 C, }) dbegin P_pick arriving
: J+ {3 b; F4 L    set A_i to procindex * 10 + 16 }" \* ~7 ?3 `4 }
    move into Q_induct(procindex), v( U& {5 H2 P
    move into pickaisle.induct(procindex)
7 W8 ^7 G) ?+ Y- R( j: m    /*check the type of pickaisle.induct(i), for your last problem.*/
* j/ Z+ }* l3 s
! L7 i8 J; e; J/ }' X    while A_i<=30 do begin: L7 W3 Y* p: l; T; r; C2 T
        travel to pickaisle.con(A_i)- h* c( E: p/ g. t* [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 g! `6 \8 A: o; B0 D( J: Y        else wait for 10 sec' v2 q$ u& U: Y- F
        if A_i=A_leave then send to die% [/ C- ]$ K0 Z% K9 a8 h
        else inc A_i by 1
, B& ^: R% q0 A) O    end
. K$ ]/ S$ Y5 Q! ?end6 J& l9 R0 e  A+ Z/ Y: y) y

2 V0 r. ]2 S& P) ^2 ~3 ]其中的procindex为整形,代表当前process的序号。
# {/ s9 y6 l8 |- o( {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-1-31 13:53 , Processed in 0.016678 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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