设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13827|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  I# m1 `& j4 t. x0 {  K3 w: ?6 p; E; f" ~% D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  Y" [2 p& P  [' e- R3 ?( U5 k
) m. m  p, `  V' K7 k, a7 wbegin P_read arriving
. @- C! G" C! O! e7 P% U    while 1=1 do begin
9 Z1 c: `1 q/ ^6 u        read A_tote from "data.txt" with delimiter "\n"
' x  S. z+ k* w        read A_time from "data.txt" with delimiter "\n"( I% m' J. i$ a- ?
        read A_leave from "data.txt" with delimiter "\n"% `4 Z  l8 \; u, v2 U" ~: a
        read A_picks from "data.txt" with delimiter "\n"% l  _5 ?" b: U0 u: }% b
        set load type to A_tote
: g& D$ X  p: f% w* d" |        if A_tote="tote 1" then set A_induct to 10 W9 w& k) D. K" w  T' m2 J
        else if A_tote="tote 2" then set A_induct to 2
* [+ r! Q: J5 j( v            else set A_induct to 3   
9 @  a; h+ k' s9 k; G4 s        set A_i to 0
8 K: s2 l8 o( m8 Y        clone 1 load to P_induction- E! Y. k8 e+ e* A
        wait for A_time sec/ X: s7 p# j. `2 G% B- a6 G
    end2 p) R8 Q8 ~  e0 f7 n$ s9 D( y8 y% I
end
; Z9 ]  q. a) j( ^( i6 D# R" c- A! m5 N% G% B
begin P_induction arriving4 @7 e2 a4 S+ \6 _- `2 `3 H. w  y' D. L
    if A_induct=1 then clone 1 load to P_pick1
* t$ D* l# [3 V9 A; }) V% K    else if A_induct=2 then clone 1 load to P_pick2% n4 y, }3 X: {8 Y' }
        else clone 1 load to P_pick3
+ H  E9 e2 V  b$ M, ~+ u4 xend
/ W0 A& X! E& d; P& m. c' p
  V* m' j# l" T  Xbegin P_pick1 arriving
6 m$ ]" ?- F2 v% a! f    set A_i to 1
; G7 s& y! k9 `1 i+ O( g/ [* M    move into Q_induct1
- i* S+ r4 N% P    move into pickaisle.induct1
1 n( d+ B- w6 L& t8 a4 T    while A_i<=30 do begin" x1 W) v0 X. ~
        travel to pickaisle.con(A_i)6 b0 N: `0 y$ r1 z3 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `+ g: o+ C. C! s6 g  H2 y5 P- R        else wait for 10 sec2 T8 l/ b0 d3 J
        if A_i=A_leave then send to die( F9 N. P3 i5 }, X5 o
        else inc A_i by 13 ?- t$ J* H8 R: i
    end
2 ]( m2 p- v; Z1 x3 }0 V. D: \end. C% V- q: |1 k& o; a2 e' g
2 b$ K+ o: F& i/ o1 y# F
begin P_pick2 arriving2 `! n, d3 H% Z( m# S! P' J
    set A_i to 11
: K% i& x; ]9 N, D. D- k. Z    move into Q_induct2
  p. K0 X* p+ h3 @/ F    move into pickaisle.induct2/ ]7 q# m4 x4 |% P
    while A_i<=30 do begin! _) S1 ~3 |; X) i/ C& z' G1 f
        travel to pickaisle.con(A_i)
) f: Z+ a: F+ \" {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. K5 X. H* l! B) {        else wait for 10 sec: E+ {3 j* D4 u: o' v
        if A_i=A_leave then send to die" k' ~8 n) V$ w; }
        else inc A_i by 1. _0 s5 y, }& E
    end
2 s, u6 ]* s. C  R% [/ J  i6 \, O$ Aend/ I5 W( P8 s5 V) `

7 p/ N0 F# S  X, Q2 cbegin P_pick3 arriving1 U; v! Z. c) g/ n1 h3 L1 O! k/ L
    set A_i to 216 O2 {9 }1 f, W7 u2 R, T' V
    move into Q_induct3
6 q8 d5 u7 l# |  o2 z    move into pickaisle.induct3  W# g6 _; l2 n0 A
    while A_i<=30 do begin4 q' O7 l$ L( w7 i# u+ L
        travel to pickaisle.con(A_i)2 A" r7 p- A0 K  r2 }2 S8 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ q+ n& X# J& z
        else wait for 10 sec
# U% d  @2 s. Q- x. e5 c2 Z8 k        if A_i=A_leave then send to die2 C$ T& a9 B' J1 N! ~1 d5 c
        else inc A_i by 1! v- p4 l1 b' v1 ]/ d
    end
1 }/ p# m$ T+ U& X- X) Hend

最佳答案

查看完整内容

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是个什么东东?
. c) u- N% S+ S7 Amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' R, N+ ?, }0 L' G4 s
" c% l1 @0 U2 T8 t# bAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 Y, {! a+ N: O! b2 \2 w
& R( j8 f6 x+ K$ H# b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 i2 L" G. f9 k% t+ _5 k1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 o# t8 W/ @2 P' n. X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( o1 E" @# D7 X2 t: P; U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 B- P/ W/ q- T# [7 A1 A/ q, mbegin P_induction arriving
' a5 t8 w1 }/ q3 S+ C    clone 1 load to P_pick(A_induct)0 p- ~$ C3 P# _$ H* H; a5 z
end最大的系& ?/ z9 S% e9 N( N! x; Q+ \2 F9 s% q
  {( L& p; i8 _/ A8 F
begin P_pick arriving* {1 V" E. Y8 V6 y4 z0 ?% B
    set A_i to procindex * 10 + 1
. [2 P3 n! S4 P7 b3 v- F; `    move into Q_induct(procindex)
& ]2 w5 X5 L- L1 T3 J    move into pickaisle.induct(procindex)
7 I& ~7 W4 L5 }, T+ \9 Q+ m( P! i    /*check the type of pickaisle.induct(i), for your last problem.*/
- ~( U2 X1 }; p$ M! l, l
7 W% b* [+ J  p& b7 t6 s    while A_i<=30 do begin
5 u/ O  a, Z; H3 |% C  g        travel to pickaisle.con(A_i)- f& @7 P' U% a7 u( X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 m' v, Z1 l4 ]1 U% I/ n        else wait for 10 sec
5 k+ I- _5 `* T; H* v5 r- s# \        if A_i=A_leave then send to die
# V( S% J* N8 X4 M$ [& u        else inc A_i by 1
- }. R/ }3 a6 ]5 @2 e  c/ n1 a    end% Q' n9 t* Y' F# i4 v) h1 P
end
' V  T! {. D# y) w& j: m7 q: R' t) [+ E' @3 I1 v5 Y
其中的procindex为整形,代表当前process的序号。5 Z/ y5 A. ]) [0 b0 m5 S( `+ [! k5 f
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-5-8 15:48 , Processed in 0.015868 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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