设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13386|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& A6 D+ {; F$ N/ B; N9 r6 x
' \5 v! j7 @- c7 c# 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中的数值,不知道会不会有什么不妥。' U$ z4 I) p* V7 G% d1 i. m

6 C3 \. V' T& |: g: s" Y* k) [# Ebegin P_read arriving6 x7 `; ^+ ^! H" V4 {1 s% |* K
    while 1=1 do begin
0 f' t3 h% {) k$ @        read A_tote from "data.txt" with delimiter "\n"
$ V: w3 O& X1 |6 U, C        read A_time from "data.txt" with delimiter "\n"# y  \2 u. I" Q; @- X6 I
        read A_leave from "data.txt" with delimiter "\n"
. e" M5 c0 V% Z/ \5 a        read A_picks from "data.txt" with delimiter "\n"
$ n6 ~# F& A' s5 s! L: }9 l        set load type to A_tote6 H! Z0 f( F9 q  D! ]% F% v0 |
        if A_tote="tote 1" then set A_induct to 1
* ]/ g* S' X; V+ x        else if A_tote="tote 2" then set A_induct to 2+ l( @# U* C5 ~( L) Y+ C7 a
            else set A_induct to 3   
9 E1 P; g6 b% p7 Y        set A_i to 0! ~# z8 v) t# e  t& m0 B0 [+ V0 ]
        clone 1 load to P_induction
- ~. S* U8 ]& @- d; S7 ?        wait for A_time sec+ T" I' m, _$ N2 k. w. r
    end
: H8 u' }) o8 O, iend
6 M) q, Y8 n6 D0 Y& w/ ^0 L
# N: n8 \* a4 T; m+ ?begin P_induction arriving5 P/ O4 O8 b0 l, r
    if A_induct=1 then clone 1 load to P_pick1
2 t& t5 M4 n+ C9 ~    else if A_induct=2 then clone 1 load to P_pick2- }) [& x  {! {) |/ t+ B
        else clone 1 load to P_pick3# ^% }* Z4 @+ s6 f
end
) E2 _3 d* s) [* \( h$ v/ G- v. a& M7 L: E  }
begin P_pick1 arriving/ c# Y7 H; z  ^% w2 E. N* X9 o% ?
    set A_i to 1: O. }7 H- z# K; e# S9 l
    move into Q_induct1. q  k. Y+ ]$ ]' i% Z# @
    move into pickaisle.induct15 I6 c8 u. m+ T; \% G
    while A_i<=30 do begin
9 ~: y7 }; ?) n        travel to pickaisle.con(A_i)
8 q1 t8 ]2 Y2 L' K2 R; K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; T$ l$ _5 ^3 W
        else wait for 10 sec/ _" A# C! r5 r( c( N, b) R2 n
        if A_i=A_leave then send to die
" @  x: C4 K# L- N" }        else inc A_i by 10 M: Q4 |# D( B" b8 T1 x
    end; i. v9 ?7 b1 O! `, H: M0 n7 _
end/ l) j$ k: P* c' u# _! ~
. @0 n( j2 A9 _3 @
begin P_pick2 arriving  t- _, I" ]2 D
    set A_i to 11: Q: g) b) H% ^0 y0 @4 }4 z9 Z
    move into Q_induct2
4 J9 e8 B1 m3 r& r, `' A    move into pickaisle.induct2* M+ |% O! r! U
    while A_i<=30 do begin
6 W' W' g5 ?! O0 V        travel to pickaisle.con(A_i)
( i, N+ ~$ Y+ }! r0 ~( D5 ]4 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; e* u5 I2 p! W) i0 ~
        else wait for 10 sec7 p) C+ n* H; K  F+ ]
        if A_i=A_leave then send to die6 `$ e* B8 [3 N. ^/ R' w- [# i
        else inc A_i by 1" A$ k% V- R2 P, J- y
    end
$ c4 g$ z' _, l# N: T1 C4 Xend
& S4 ?5 w  P5 ]+ m/ G& ^0 O5 T$ R: _
begin P_pick3 arriving, `6 ~2 S8 x! q3 @  V9 u8 q& x" a, U/ f
    set A_i to 21" Q! S4 H" i* L$ O- K  j
    move into Q_induct3* C2 L1 B9 V$ T
    move into pickaisle.induct39 G! ]2 Q( p" a. s* s
    while A_i<=30 do begin4 K. H$ E) ?$ b: v
        travel to pickaisle.con(A_i)
# `$ }" C/ @9 d4 Z3 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' N5 y5 w% Z9 ]' r: V! f% l. T6 _2 r        else wait for 10 sec
  i0 D. B: @- A, |7 h# h        if A_i=A_leave then send to die
+ @! T/ k6 X4 P        else inc A_i by 1! K  ^& k* R! h) S; R' m5 s
    end
% K  c: a4 b# P  v# Yend

最佳答案

查看完整内容

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是个什么东东?# w. a8 s! X% p/ e' r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 `6 U1 d3 E* C  I7 B; @' t8 B7 U+ @8 y) P& F, O0 Q! p. W. V  R
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: Q# Y. @& A, ~9 C+ y$ V1 J0 _# Y  b4 a

! q2 g  `* R  g5 Z+ ^5 u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ N5 `5 f% {. \" W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 u' n- [! y9 N# E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( E" T7 T8 t& r4 M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. e% w3 e' O! c) Ebegin P_induction arriving- }2 Y: I& j4 D3 q/ J# [
    clone 1 load to P_pick(A_induct)6 H) C- _) ]9 Z0 V) s8 Z3 i
end最大的系
, A; j1 F6 [$ U$ d1 G+ K: T8 `! ]. H
* D- B0 e4 |1 C( ]2 }. Zbegin P_pick arriving
8 r& p) ]7 z' A/ o' Y( v    set A_i to procindex * 10 + 19 M/ J$ {9 P9 p+ \9 P! \) h5 n
    move into Q_induct(procindex)3 z' A9 c: {0 h' o  n5 Z5 T
    move into pickaisle.induct(procindex)* d5 J& e7 h- t7 R* G: d
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ C( d& a" q5 A& |% B5 ?* Y
5 |- H" p: z; s: p! t9 F    while A_i<=30 do begin
: G. ]0 I6 M# P1 f5 E* J' h+ M        travel to pickaisle.con(A_i); D6 {- ?) [$ b. g& t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) `" V6 p* m: {- W/ ~  v' X5 M1 M        else wait for 10 sec) h8 d' T5 K  T9 @
        if A_i=A_leave then send to die1 d$ j% s5 y; v5 N* v
        else inc A_i by 12 d, @1 u. y5 w1 b/ b: E2 ~5 [
    end  [/ \# ]- Z3 O, u
end9 Z2 Z9 \. t2 w7 i. k& {! x

8 u+ w3 E3 K& A, {5 }; m# M其中的procindex为整形,代表当前process的序号。; G" h& s; L$ \
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-4-9 08:26 , Processed in 0.021572 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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