设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12103|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. n/ L7 P2 `+ x7 G0 `# j
- V5 S9 B+ o) f: b, G! n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) q( j9 a* y/ Q) W

5 Q! J. J( I  hbegin P_read arriving
* a) t/ T+ n0 m* D3 N6 s# H    while 1=1 do begin
  j+ ?8 h) e' D: Q5 L' W        read A_tote from "data.txt" with delimiter "\n"# t8 g7 R" V5 I1 H
        read A_time from "data.txt" with delimiter "\n"
4 U# b3 V1 m9 l7 y        read A_leave from "data.txt" with delimiter "\n"* M$ T5 h, c" o. V3 g7 Y
        read A_picks from "data.txt" with delimiter "\n"
: W" |5 T; W' ]        set load type to A_tote2 a) }1 {- g, g8 K3 I& g. V
        if A_tote="tote 1" then set A_induct to 1
$ ^( ~  z9 o2 o  n0 \% a        else if A_tote="tote 2" then set A_induct to 2
; P1 N6 M8 `& V* l4 T5 e8 D5 o& j            else set A_induct to 3    . V! t/ X5 U4 n  j; V
        set A_i to 0
1 X* u) p, ?+ A7 k/ \        clone 1 load to P_induction
: a4 h; c# v0 q$ }# Y7 c, l        wait for A_time sec2 y; D% [, J! w3 Y' s; m
    end
8 r% c5 t7 t( H# T1 i7 n2 ]8 tend
, J: k- y& n8 B* x3 D# L+ \. y3 c$ |2 K$ ~* Q6 U, }, ]
begin P_induction arriving
- j# r; V$ q1 o: r# @  M. [    if A_induct=1 then clone 1 load to P_pick1+ {0 _* r# G2 J6 x
    else if A_induct=2 then clone 1 load to P_pick2
3 Z: V4 E4 ]+ h; P: z* E- [        else clone 1 load to P_pick3' C5 l  K3 E% {
end$ x! c2 V  L8 ~" W) y! T; _  `
# n( `* @% O; ^* g1 C
begin P_pick1 arriving
& R, F( ~* u4 K" a% k8 i1 O/ V' J; x    set A_i to 1
2 T5 a" f7 ]3 W" q! [- e    move into Q_induct13 h3 l6 v, Z* l- |$ X1 V7 C
    move into pickaisle.induct1
! [  O$ L# u$ q$ e$ w    while A_i<=30 do begin
  {! N" z. m5 I1 a        travel to pickaisle.con(A_i)0 V; P* b) a- X7 E3 m8 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 B" y" e9 ~; y0 N% ]' Z6 f6 Q        else wait for 10 sec& }$ o/ B* s: b, n
        if A_i=A_leave then send to die
! _5 h  O  S# x- n        else inc A_i by 1
) X- f0 y6 ]$ [, y8 s    end. k  z5 v5 w6 I$ a5 Z2 T1 y: x
end; M/ V, ~+ I9 c7 x

0 n+ B3 ~) r  |9 l' b' s" lbegin P_pick2 arriving( a( c& X" H4 |3 u- F/ }
    set A_i to 11  Y. I2 z" j6 f& B- e' ]- @2 ^$ r
    move into Q_induct2* l/ j: d/ J& ?, O0 c6 {% e
    move into pickaisle.induct2# u& G  \$ M) L7 F1 h2 B
    while A_i<=30 do begin+ `8 z7 o+ j% m* c
        travel to pickaisle.con(A_i)" L6 b! T* N8 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ Z& f. m2 R7 O* C( k        else wait for 10 sec
7 c9 y: |  J" K4 P0 ]        if A_i=A_leave then send to die" b  [0 F* a0 @3 N' n
        else inc A_i by 1/ y, Z+ w5 {3 z9 p
    end; a, j& D% |9 o  p
end! `  n. d' l1 n4 Y' @& u3 O  h
% l. R7 L4 t, h" k% l
begin P_pick3 arriving
$ T! E/ b5 X1 {0 S- F    set A_i to 21
) |; ]' s0 z1 I    move into Q_induct3$ e+ e' M- ]' l, ?5 A" p
    move into pickaisle.induct3: Q/ b8 e1 f1 T" c( `
    while A_i<=30 do begin
. @% |  T/ e1 M) Z0 M        travel to pickaisle.con(A_i)' v2 Z4 R9 H% q. C0 V9 d! s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 \# F9 C2 l4 ^: M# D2 V* g' u        else wait for 10 sec) \$ ]+ B9 z8 m( |1 h$ ~* c1 N
        if A_i=A_leave then send to die
% N5 d+ q* Z4 f( q" f3 j8 p% S5 ^        else inc A_i by 1
; Z! C7 v5 ~, l; Z9 }    end+ H4 @( ^1 W5 c( d* B
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是个什么东东?
% H: @, T4 {+ O. Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! i" I# {  v8 S2 S5 h: {
2 X3 |, ~& p5 q' ^5 `% J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! B# u/ C( c# H5 Z! V# \& F& Q0 g' U6 O) s) d& }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% \1 h4 i+ g' E! W7 p0 @+ B/ V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: T6 W, c. b2 f4 y5 @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; ^! y1 D( w, d4 r6 @- Y  ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- {$ q* _! i8 z7 k
begin P_induction arriving
1 L, o. i6 g! D    clone 1 load to P_pick(A_induct)
  j6 W! q7 H+ m7 J% S. G$ |; \end最大的系+ M! a0 k' Y7 p$ @
, D4 l: ]$ w. m3 ?: \& u8 J" k
begin P_pick arriving9 Y: G( t7 _4 K; I: D, K$ y; q
    set A_i to procindex * 10 + 1, d3 E3 P% p; B: Q+ n$ B! }
    move into Q_induct(procindex)
; G$ E+ k: u$ o    move into pickaisle.induct(procindex)
2 g2 \1 b( W( C! V5 e+ F    /*check the type of pickaisle.induct(i), for your last problem.*/
2 e; P7 D5 {4 @2 N/ q6 y) |; p' u. U% P. S- g
    while A_i<=30 do begin7 s- S/ i0 ?! f
        travel to pickaisle.con(A_i)7 W/ a# a9 h5 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 M. X' h& B, j6 v4 b
        else wait for 10 sec
* t/ m- {2 C8 J! Q& {) H' A6 U        if A_i=A_leave then send to die) Q0 U! B+ ~  o6 j# ?
        else inc A_i by 1: D* x, h6 ^- j: c5 R
    end
6 o& x( u% a9 pend
+ P. L& o( `% _  z- O& V6 |
0 t2 A/ ^1 Y( G2 p+ H1 k其中的procindex为整形,代表当前process的序号。, N% {4 k* b+ v3 A; e9 ^
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, 2025-12-28 05:40 , Processed in 0.017352 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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