设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13378|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ S9 b3 }; B$ ^! w* E( s& r( }
8 {9 u9 g+ Y8 v/ f$ p9 Y. Q! Q8 x我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ c0 r1 X; ?+ q# R0 u4 _
6 n, j/ |/ n$ o, F# Mbegin P_read arriving- H6 ?- D; B4 B- x. B+ F$ f
    while 1=1 do begin
1 n9 ?- [& R. Y        read A_tote from "data.txt" with delimiter "\n"
% r& J7 D: N" H& U" J1 K% U        read A_time from "data.txt" with delimiter "\n") R" Z2 y6 P# [) H. N5 ]9 {# ?
        read A_leave from "data.txt" with delimiter "\n"
/ J0 l- Y( ^2 P  x$ z8 E) z        read A_picks from "data.txt" with delimiter "\n"
3 ]* e! Z, P. g  Y4 `3 B, t        set load type to A_tote1 _, z3 B8 Z4 y
        if A_tote="tote 1" then set A_induct to 1
! A# z! n) `2 |* {  @! T0 o        else if A_tote="tote 2" then set A_induct to 2# O& _9 L# O( S& K) H, D
            else set A_induct to 3   
, f/ l4 E" G* b        set A_i to 0+ J/ O4 _1 C0 c7 ~- c/ Z
        clone 1 load to P_induction
0 B5 P! G4 {: H: j& G( m        wait for A_time sec. v0 H, w, D( S% a
    end$ i3 b% \) e1 |0 H% D
end
" g" k# ^1 J  @7 X1 j+ ^) V  M, c& F( h
begin P_induction arriving
- a9 h' b* I, n- \( Z, b    if A_induct=1 then clone 1 load to P_pick1$ a1 b7 X" F' S# k2 G% F
    else if A_induct=2 then clone 1 load to P_pick25 Y; d9 q) l% F6 Y
        else clone 1 load to P_pick3; \  P7 f0 w5 A" I) Q" Q& p
end
. \, T/ T4 {, d1 l/ `) V# u1 _& o, D$ D& F4 Q, \  P
begin P_pick1 arriving( O1 S# k2 C3 u6 ~" F3 V6 ^  R
    set A_i to 1- ?; Z" H0 m7 P# t5 l8 h3 G6 L
    move into Q_induct1
! I2 G9 a% q' y( A    move into pickaisle.induct1
: z2 h0 P& ~3 _" O' I! X    while A_i<=30 do begin0 U' }/ a  }* J7 d  `% K. j- G
        travel to pickaisle.con(A_i)
6 t$ R8 C4 \" k) S% T! W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  j' k# W1 x* E5 T6 J( r3 a" ^        else wait for 10 sec
4 e0 P; E" k5 @8 b' q& N' D        if A_i=A_leave then send to die2 U& k/ ]$ [4 q2 K
        else inc A_i by 1
/ }- a4 V8 F3 T$ _+ S    end9 j7 U1 L) y1 C
end5 n) h; V* Y& N

+ M5 l4 E* n  q) z2 z2 @begin P_pick2 arriving
2 L# {0 ^0 D7 P2 ?3 i. d+ _    set A_i to 11
7 M$ R) l8 o% J7 ^    move into Q_induct2- X0 P5 K: ?" H( X, o. w
    move into pickaisle.induct2
, S) ^" J6 V+ p2 v    while A_i<=30 do begin* V, {" v8 R' e1 b
        travel to pickaisle.con(A_i)3 R7 l2 D# j" p8 G) q0 W4 U! ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: h8 R5 h* J. }$ \; @        else wait for 10 sec- E0 k! p7 b) g) b1 t
        if A_i=A_leave then send to die
6 |0 u; i* [/ I9 A& F" S7 Z( q4 Q        else inc A_i by 1" T$ @# P/ s* `0 X
    end( L3 m2 W! y+ S; M
end
4 T* h, m9 A* Y; A; H# u! R3 v# U2 L9 p$ u
begin P_pick3 arriving, G: A& J9 c6 j8 Y) X
    set A_i to 21
' o7 {$ h) g, f    move into Q_induct36 D! D( l: F$ m
    move into pickaisle.induct3
1 l- L& h, R" s# |9 R    while A_i<=30 do begin" ?0 M3 U, r# j  H
        travel to pickaisle.con(A_i)
& i2 ]( a! v5 |. U; d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; j4 E% R+ H& o9 G7 G        else wait for 10 sec
4 N6 d% k7 H" V, T        if A_i=A_leave then send to die
" _9 i5 Y+ k# O+ b( f- O2 H0 W+ g        else inc A_i by 12 L* O& f0 y$ L
    end
* r1 C9 V" n' o" ]$ Send

最佳答案

查看完整内容

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! j; u( `3 y6 G" p4 wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 h9 C) N% A9 g  A% Q
4 @+ V/ l3 T1 |$ m& ^! VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* K/ g  |- [+ A1 d6 B% V% n2 o. ?( V% \+ W! \. t$ f7 f
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ l8 I" [  J: G0 `; j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 T9 o; g& D- F; R6 {! Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' n# O2 R/ A: a& j* U: m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; B! I- k. A% v0 j1 ]9 Lbegin P_induction arriving. E2 g  E7 n7 [- V1 ^
    clone 1 load to P_pick(A_induct)
% m# E9 }5 n: I% S6 j9 h: s/ dend最大的系; u# M- v! W' @, [1 S4 K
% @2 ~: l) U# [5 h# R- K
begin P_pick arriving
9 R$ O1 r$ j5 _$ R% G  A    set A_i to procindex * 10 + 1% e3 v# c1 |$ Z) f) S
    move into Q_induct(procindex)
1 q  h* y- n+ [( y: u6 i& x4 j9 W! T  [% I- v    move into pickaisle.induct(procindex)
9 Z+ O# j% C$ G    /*check the type of pickaisle.induct(i), for your last problem.*/6 m1 Y$ Z! F6 ]

- a: L; d: }* x5 q, Z/ L7 [8 x5 V9 D    while A_i<=30 do begin0 N2 C/ i! W; y! k: ~2 D6 Y
        travel to pickaisle.con(A_i)) \* R2 s& L& l2 z- y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Y/ L* Q3 w. v        else wait for 10 sec! q2 U/ |% _: _+ t" R1 G# z; Y
        if A_i=A_leave then send to die9 X2 g$ C* @# x7 H1 i( }9 O* ?( H/ O
        else inc A_i by 19 F1 _% m4 U4 p. q- c: j; |1 V
    end" }7 x' x% g# x5 E& N: {. t
end& m5 `0 @/ D; ^5 B7 c
" g6 Z! _) W5 s( c- q4 N
其中的procindex为整形,代表当前process的序号。; F2 Q& t4 d3 r  v
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-4-8 09:16 , Processed in 0.018138 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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