设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14437|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 G( ]5 ^" e/ ]" V. A, ~7 }$ l$ X  {9 P; M0 }* B; C2 a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' G3 b7 n5 l4 [, a3 V  Z- F4 ]

% H% U( \/ L! o+ }3 e4 W) c% `: S9 \begin P_read arriving
* r. r( {4 A% V! [& t) C; F    while 1=1 do begin
6 J3 X- ?7 J) I& k+ a        read A_tote from "data.txt" with delimiter "\n"& x- \# |4 z$ p1 @1 x  X* X  G
        read A_time from "data.txt" with delimiter "\n"% C3 E5 A# Z2 {" X5 ^1 x7 R
        read A_leave from "data.txt" with delimiter "\n"( T, D) \  ]2 o9 L: z4 j* T
        read A_picks from "data.txt" with delimiter "\n"4 r! a1 ]4 B  a8 t' s5 q- h
        set load type to A_tote5 g; W" R% k1 M+ l; k
        if A_tote="tote 1" then set A_induct to 10 l) P, t! m5 l( `5 K' r/ G3 }* |- \, ^
        else if A_tote="tote 2" then set A_induct to 2; h2 F2 f) g* z
            else set A_induct to 3   
  T# X1 w3 b! I( A, p0 V        set A_i to 00 R  {/ m- e0 v: U5 |+ I) ^! a
        clone 1 load to P_induction
, `! l( x& M9 V& D7 n        wait for A_time sec) A7 Q* L9 d8 m4 Z! ?1 i
    end( B, }0 S$ a2 g* o4 p3 X
end
* @& e  w6 ], Z' R; p5 w& F  a
% G2 C5 [# P+ Ybegin P_induction arriving
( Y1 |1 u  C7 E    if A_induct=1 then clone 1 load to P_pick1
  }7 L$ K: L+ l  E7 Q4 |    else if A_induct=2 then clone 1 load to P_pick2$ ~$ H/ I8 s7 @
        else clone 1 load to P_pick3
* R* K. V. q9 K) Aend
; }1 a0 U1 v9 g, g. }4 \" J. _5 \1 ~3 k+ m8 R/ v
begin P_pick1 arriving  b- a( x. e$ V3 t4 l/ T% c5 b
    set A_i to 1
1 J5 z& n* @$ w5 p    move into Q_induct1
/ `  C( P2 G3 M! ?    move into pickaisle.induct1
+ E5 {$ V) T2 {! J+ m    while A_i<=30 do begin
- \1 i# b5 G& r6 e+ }7 J# [        travel to pickaisle.con(A_i)* _+ ^2 @/ `9 ]/ _  d( n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' p" y9 ^5 x: E' T! v4 d
        else wait for 10 sec
$ d2 D( N0 G- E9 z; v  x        if A_i=A_leave then send to die
( w# m' I, j1 u0 n. v' C        else inc A_i by 16 o/ s- \! b+ G
    end
8 s- b1 z) h7 _end6 u1 \# Z+ e; v: u
* `3 O3 U( D6 P- F3 Z& l) I
begin P_pick2 arriving& b) |/ \4 h; Z
    set A_i to 11) J* ~8 y2 D: E6 }: y
    move into Q_induct23 [1 H# w3 n% L7 \, W% \* Y
    move into pickaisle.induct2" `- o/ Q$ M% R, l. F* o$ u
    while A_i<=30 do begin: P3 b  O$ A$ m; T7 H. D: u; R
        travel to pickaisle.con(A_i)
. w% K% x% P5 ^: p9 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ k$ s1 Y2 t) C2 L/ i        else wait for 10 sec
# h7 M. b4 X: e2 R  y/ y$ g9 S        if A_i=A_leave then send to die3 L. o' a7 ]( R# O% o
        else inc A_i by 18 x; e# ~) N7 x# q4 }: j$ `  R
    end
/ g8 _# A3 o) L7 g$ p+ \end
, t: y% G: G! f) @  t( {
* m) I0 C3 K; I, w: z5 k, ~0 Ubegin P_pick3 arriving; I2 U7 h0 {8 j# t6 X+ H( r: _  {; P
    set A_i to 214 l0 K" i( X) T
    move into Q_induct37 n! N6 c5 L0 p  W) ?" F, N' \
    move into pickaisle.induct3
1 m2 b7 e& i- n8 a; R+ Q4 q; H, u    while A_i<=30 do begin0 A* G' C1 ^! a5 t5 y! U  h
        travel to pickaisle.con(A_i)* J' q! b* t+ x  x6 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }4 }! o* ?' ~1 T        else wait for 10 sec
# q9 ?0 v' f2 y3 ~/ m9 d: e        if A_i=A_leave then send to die) n; Y9 i, `+ g1 L% ]8 Z3 k
        else inc A_i by 1
( u! T/ U  F) {" a! [5 W    end
3 Q4 h/ y/ t6 Iend

最佳答案

查看完整内容

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是个什么东东?+ b; b% q. r5 _" i1 J
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. h3 H9 e8 h  _8 \0 ]% W' z
  Y% R4 z9 A; CAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 M4 y6 m. H) v
- P: |# v! W$ H1 p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; b0 m0 A2 ]6 Z& z! Q4 V8 b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) E- H. l" l" }. w8 ?0 v7 b4 M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  A2 K- z/ l- }2 l7 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' F/ e' E9 }) ~7 r; }
begin P_induction arriving
7 {3 b# [3 E4 S) s5 o: A    clone 1 load to P_pick(A_induct). N% Y  Z5 U# A) `; V. I
end最大的系
2 X$ y9 P% Q8 e5 X) Q
; e, r7 V& Y+ f# [begin P_pick arriving1 `0 `/ x( q2 o% m/ m
    set A_i to procindex * 10 + 1
9 P3 {1 m% l- F    move into Q_induct(procindex)
8 E) g2 Y' a. H5 s: w! x    move into pickaisle.induct(procindex)9 f6 A7 C, J7 G
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 C5 I# _( c* o7 y
% y5 j/ Q+ x2 [& N  B5 a    while A_i<=30 do begin- J5 s2 |  P* P5 @- F& v. d
        travel to pickaisle.con(A_i)# c" ?: e, V" U  P& a8 a' I: m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 l% X" b, o* P0 F) M  r4 I+ _. x
        else wait for 10 sec: [& s  J- D; x& b4 F! G  ^5 U& v
        if A_i=A_leave then send to die
8 g. Y. r1 ^8 f& Y1 ], W        else inc A_i by 1
" G( T2 Q9 Q) }& H- |/ C+ T    end
8 z8 P" S" k/ y3 ]4 L# s! s" uend2 n) ]& _+ E' Z! d* F9 U' v  C

  b! {- H& d+ Z3 ?其中的procindex为整形,代表当前process的序号。
/ _1 n! e: [; ?; h+ u3 M+ {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-7-11 11:34 , Processed in 0.015220 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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