设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11831|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% Z+ C/ m" [2 n6 c) L$ W
* Y- P! ?0 X9 \- i" M我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ A$ @+ |7 |0 }. Z* M9 A* q
6 f" Q$ W( q- X3 o) z; _
begin P_read arriving' V6 p' O  ~: ~0 i8 T1 f" I
    while 1=1 do begin; \$ f0 t; J( o0 D/ r
        read A_tote from "data.txt" with delimiter "\n"
; u7 L, c& A6 i4 g, ?: ?  ]        read A_time from "data.txt" with delimiter "\n"
0 c4 q* E: e5 x        read A_leave from "data.txt" with delimiter "\n"
8 d' o2 ?. G" A+ o" V! B& B        read A_picks from "data.txt" with delimiter "\n"2 i- O6 K* m- E( z, ?! c
        set load type to A_tote* G- a5 }3 V% y* p, b2 U: v7 }- I/ D
        if A_tote="tote 1" then set A_induct to 1
% D. x, D# W4 q' U$ G        else if A_tote="tote 2" then set A_induct to 2
9 v- z! I# o2 F# A, Z            else set A_induct to 3   
7 y- q5 @, K+ Y' U5 ?        set A_i to 09 L+ p. q- D% N0 {2 ~4 F+ B1 t
        clone 1 load to P_induction
8 h8 A9 A! X8 V' O: r9 v        wait for A_time sec7 N: X4 d! y. N
    end
  D- `. s9 z$ Q% O4 i* ?2 {" @2 vend
) Z' s% A4 z* b( P5 c; }5 E7 j. |
begin P_induction arriving
4 ^+ B( r# x3 }4 y' w$ [    if A_induct=1 then clone 1 load to P_pick1; X$ F4 Z% _6 K% S( n- i- E5 V
    else if A_induct=2 then clone 1 load to P_pick2
# c6 }) m, \8 l% Y        else clone 1 load to P_pick3
4 x1 S' F; W% b" R  }$ ^3 H- [end
' i  l* l3 B) l- T  |" T7 C
, b- h  M7 R% i8 x0 ?% w4 nbegin P_pick1 arriving
0 i5 c; ^# G$ Q+ n$ V    set A_i to 1
9 D$ }3 V1 M! e" `' f, f/ I    move into Q_induct1
0 N, J5 ], q8 {# [, P  e4 s3 a5 e% B8 p    move into pickaisle.induct11 W, \. Q% R+ E* c5 R
    while A_i<=30 do begin! w7 V  h. i* ~& G
        travel to pickaisle.con(A_i)
/ \$ M3 y4 n# e8 [5 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# L: r' k# T2 ?. {) J8 X
        else wait for 10 sec
' R2 l1 d! b- u0 a        if A_i=A_leave then send to die4 b, t: F: k, O; W0 O
        else inc A_i by 1
1 U6 Q  j7 F) g' p- O- n    end; s9 m0 G4 g8 j; k& M" R
end3 H7 m+ ^' ?* x" z

+ g$ R# V7 n* b+ f) o; \- bbegin P_pick2 arriving
8 ^5 o) b% ^' z8 _    set A_i to 11
0 P: F$ \: p' j4 l, w    move into Q_induct2
* j$ J0 ]) m& c; m! h' p    move into pickaisle.induct2; l2 c; t4 D" o: t9 a" M
    while A_i<=30 do begin
' x7 ]* a) d2 g8 M        travel to pickaisle.con(A_i): }" Y5 C7 P7 X) I& m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d) w/ z+ B! c) J7 a& D
        else wait for 10 sec0 `7 ]0 a* c) T2 m
        if A_i=A_leave then send to die
: l- n. [# a. d0 z3 K        else inc A_i by 1- N0 I7 ?$ t. Y: Z1 v
    end, R! g6 N  q' ]6 |5 Y6 `, f' `
end
! y# f5 D1 J- f( B8 b2 H; u6 [/ {$ @$ d7 c" \, S. E# G$ A( j
begin P_pick3 arriving8 T1 s4 h, s" e# [  F8 d
    set A_i to 21
/ c8 w  z: k$ k/ K3 M8 F5 E( J    move into Q_induct3
; G* q+ z, u8 f) V! _+ j6 m. p    move into pickaisle.induct30 W+ W2 O! x+ ]8 R# T
    while A_i<=30 do begin
# Z- W  c  }. o" e- i7 `* Y7 {        travel to pickaisle.con(A_i). D" o. d) R6 d$ {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. \! B+ |  l8 ?$ S  [) G# z- I
        else wait for 10 sec  }; z$ E( J7 k% B9 X+ v
        if A_i=A_leave then send to die
: n: r6 S/ s( `" m- f        else inc A_i by 1
/ I: J) ]* {4 d9 K' F    end2 C4 R7 |- w6 o1 |2 |* E, W
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是个什么东东?
  Z7 I, v% R' H, ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 w3 `" h! a) p+ j! \+ k" L; A' V3 {( v; K, x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! V* U4 [5 ]7 A7 [" D# {# j7 n1 Z8 r, ^8 K; T4 H% s8 v; g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" ^$ P% Y: e6 C) l2 e: Z. _! c1 C3 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 z: I, G+ R: s3 D9 X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 q5 ^, F# K: ?' H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' g/ |  ]+ Y4 U/ j- I& l7 Qbegin P_induction arriving. h  e& _$ ]; Y5 `3 ^3 F
    clone 1 load to P_pick(A_induct)/ }8 G6 e( @- a+ I# @. B; J
end最大的系
: q5 E5 r; z4 @1 x! ?; O
8 @- t  b& I* F# I% d3 C; ]begin P_pick arriving/ y! Q6 {+ ?1 J) ~  @5 Z. E5 n
    set A_i to procindex * 10 + 1
& e8 n' X3 P' V  u9 V    move into Q_induct(procindex)' S- ^* e$ a# w! G' g+ r: U5 m
    move into pickaisle.induct(procindex)
9 f! I8 T8 ~$ L) u. B    /*check the type of pickaisle.induct(i), for your last problem.*/
9 v& q( C9 Q" S' ~5 R9 Z( i7 @) {! B; G$ l! x( y; _
    while A_i<=30 do begin
  q; P5 R: O( ^4 _6 O9 q/ g$ [$ s% ?        travel to pickaisle.con(A_i)( o) }; ~' Y) q0 E. u5 a1 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' V3 s# W4 y3 l2 Z" s8 U! f
        else wait for 10 sec# M& O& Z; ]- y" r6 q& X
        if A_i=A_leave then send to die
1 {! ~# _# z" ]. N, ^        else inc A_i by 17 d3 W( h6 f5 W& p1 A
    end
0 {# [! V! [, y2 ^: n, G3 jend
/ e8 T( m0 G( A3 T! y3 S) A3 X$ J; U
其中的procindex为整形,代表当前process的序号。
8 W2 l" N: [" T0 E! m3 Zstation和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-8 20:51 , Processed in 0.015033 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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