设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14642|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q5 B/ ?; L  M
4 f) y+ r* U- i. 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中的数值,不知道会不会有什么不妥。
- ?3 m6 }, n% L; Y$ ^% N8 L
! V+ r( Y$ j7 I: q  Jbegin P_read arriving
: O- k! w3 s  }; C9 @    while 1=1 do begin
2 q0 ^2 Q# o! c) h) V        read A_tote from "data.txt" with delimiter "\n"
4 k3 V2 t1 t0 Q3 s        read A_time from "data.txt" with delimiter "\n"
) ^% F5 }6 }5 [5 W        read A_leave from "data.txt" with delimiter "\n"/ ^2 b* l1 g. n3 y, ?  p
        read A_picks from "data.txt" with delimiter "\n"  M  [/ n: V3 S& p" z7 Z
        set load type to A_tote
, n2 S( K/ q, H8 j9 `: r2 ]1 F        if A_tote="tote 1" then set A_induct to 1* `, l* T3 R- K$ N+ [6 E) r5 g
        else if A_tote="tote 2" then set A_induct to 2# j% b6 S- k3 }- J$ f) x
            else set A_induct to 3   
8 n; {; ], J! @        set A_i to 0
' w; ~/ [5 V2 G5 K8 f0 W/ K        clone 1 load to P_induction
- T" W, a; Z6 }6 q8 ~/ r        wait for A_time sec: x4 M! ^3 s0 ]! v0 @
    end
" }6 j; ~( D- mend
* B( n+ O' y& {0 X7 j" Z# ^7 @
3 E4 G' e- C3 m; @. S. |begin P_induction arriving
+ W: D2 \5 e( e* M* ~' ^    if A_induct=1 then clone 1 load to P_pick1+ q1 r6 \, I1 {7 P' X! l2 D
    else if A_induct=2 then clone 1 load to P_pick2
2 J1 V2 e8 H! R) t. f. H        else clone 1 load to P_pick3& M5 D# X  G+ d6 Z- u# {: d8 n
end
8 t# }% l+ b0 t3 h. ?0 o% l' h9 H+ s: |/ l  c6 S
begin P_pick1 arriving
) v6 S. @7 I3 k$ C: j$ `) f; S    set A_i to 1
" E+ P" A8 D# k4 e    move into Q_induct1" M2 n2 c8 M6 R* n/ R6 M
    move into pickaisle.induct1, j7 R: N5 m  ?
    while A_i<=30 do begin* v/ x' b' Y& e
        travel to pickaisle.con(A_i)
3 {" D* d- J9 E: D" L$ @- F7 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Z2 @  C" d7 {9 h6 ?* t        else wait for 10 sec; I8 S5 Y! I- \: M
        if A_i=A_leave then send to die6 M$ I2 S! O  u+ F0 I
        else inc A_i by 1( j+ o6 O) a  I7 Z
    end" v  {# g, L: u  ^
end
) Q% U2 [3 }  a3 p- Y& e7 A( s! M( z7 U' n
begin P_pick2 arriving/ t" o- t# H) n* K
    set A_i to 11
6 V6 w: m( R" i6 k. ^6 ^6 [    move into Q_induct2
% C8 }4 H( M- j& {% T7 b    move into pickaisle.induct25 w- L: L. U. _' P$ s
    while A_i<=30 do begin
& A0 \0 v% h  j7 z- m# E$ d+ {        travel to pickaisle.con(A_i)
; E/ ]2 \! c) N2 Y/ P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' l6 x2 Y" a+ r
        else wait for 10 sec
  _4 @" N9 W% f6 q  J5 R: n        if A_i=A_leave then send to die
. `; J5 b9 O2 @# D2 W# N  n        else inc A_i by 16 j! ]% }, r( i' W
    end
1 o4 m7 L- i  L0 tend
% L$ T- m8 ^% S& D% U7 v  F& |; C& H8 x0 u% r$ D
begin P_pick3 arriving
8 W5 M" _% E7 K/ Q. p$ u( k    set A_i to 21' v4 k& |' F& o, t7 O' d, M2 ], p
    move into Q_induct3
7 q9 N' H8 E9 h& ?5 v    move into pickaisle.induct3
) n! x& }  V+ ?  U    while A_i<=30 do begin/ N( o  w# w, d+ n8 h
        travel to pickaisle.con(A_i)$ F2 ]! E( P- l4 A- i' |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 R0 P4 v, z' B& h
        else wait for 10 sec
3 {) s! S$ U5 Y" \& p        if A_i=A_leave then send to die8 m) m/ O& z3 L9 R( Q8 n8 n
        else inc A_i by 1# J( o) f9 b; B4 @, _
    end
  c1 R5 ^& U3 J* X: `& xend

最佳答案

查看完整内容

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是个什么东东?
- d. l* G& G  B- H6 n8 Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, ?0 P/ I2 K) v' D6 R7 ?
) P+ c6 C- b$ [& s5 O5 C1 fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& D/ N. `( a; ~6 a( U! X- V7 a

3 J/ a+ _, o& E: k3 H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# w( f5 x. @# \5 j+ {( O7 G; N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- W9 m6 I/ K$ F( w9 [$ @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" L7 ?* r4 U, ~0 y+ c) i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ G  j. [3 e$ G: E3 q2 Q% jbegin P_induction arriving
, w+ z- R9 v9 Z/ j' J1 c+ z7 H5 }    clone 1 load to P_pick(A_induct)
% t3 [" k& J( @2 _8 ]end最大的系
! j, Z! E, X; Z0 O( Y& s& e0 Z( a. u2 j/ d, p8 y/ T' y
begin P_pick arriving
' ~8 Q3 p) k' v  ?* Y7 H5 a7 b' l    set A_i to procindex * 10 + 1
3 ]% O4 @+ |; Q. J; R    move into Q_induct(procindex)" `' u6 o( N9 j
    move into pickaisle.induct(procindex)
7 T  V; `" k# j, G4 w    /*check the type of pickaisle.induct(i), for your last problem.*/. R8 w2 _6 _- y( ]
$ A  ~$ ^6 u. y% d
    while A_i<=30 do begin
; U- {5 J- W# s; c3 E$ A        travel to pickaisle.con(A_i)
; O! e! t6 w4 z8 Y( q3 X  U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 G0 \8 w; V2 [' J% b8 x( p  d8 y
        else wait for 10 sec
: v4 U2 b: ^6 ^* l0 H. K        if A_i=A_leave then send to die
( M1 q2 S( Z+ d        else inc A_i by 1
. ]. }; K; @" O, x    end
% ~3 ~. [' l! Z0 [end
, K$ a0 j5 q$ C* H0 m
! ^  J2 o( ~$ C0 ?$ H: A% V7 [" u" A其中的procindex为整形,代表当前process的序号。6 U: E1 H4 O# Y/ c# J
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-19 16:13 , Processed in 0.018279 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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