设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15193|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# `9 N) L4 ~2 U; B( t7 T, m0 B' S
' m: g; V% `6 V( `$ X0 r% Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。# F: j  M7 J/ M; {% H! x

4 V% H7 K& _$ J" c, N7 n# D" {/ Tbegin P_read arriving  Q: v1 i. [0 p0 w
    while 1=1 do begin" r6 [8 E5 c  i3 \1 d- q
        read A_tote from "data.txt" with delimiter "\n"
& a: O' Z1 p% I, b" F        read A_time from "data.txt" with delimiter "\n"
% n' H. w! e2 M$ K* M        read A_leave from "data.txt" with delimiter "\n"
4 C5 Q- [1 c8 i; N' {) b        read A_picks from "data.txt" with delimiter "\n"
+ n8 |) }* R* Y        set load type to A_tote
- ]6 j- F4 u2 V7 |: T* P+ d- x        if A_tote="tote 1" then set A_induct to 1
; K( m2 U$ g  q) V7 E        else if A_tote="tote 2" then set A_induct to 2
) e/ v) u" u2 }! z# D6 S- L3 m) ?            else set A_induct to 3    6 }6 v/ H: F9 I! i1 D
        set A_i to 0' v6 a7 ~' O7 d+ n1 Q) c
        clone 1 load to P_induction7 @2 y5 h) V2 ]# F2 v& q2 W* Y
        wait for A_time sec
5 y' q1 o& r& \- k# }    end
7 u. G! n2 X$ U& p  Wend2 W% T6 X2 {1 r- W6 y
0 [7 i9 N+ _, k7 y; L* G. \4 z
begin P_induction arriving
3 n( f& K( s& A# b    if A_induct=1 then clone 1 load to P_pick1
7 V5 j" }# ~! s/ @    else if A_induct=2 then clone 1 load to P_pick2" T2 w# N% x7 F& h6 _8 G2 I
        else clone 1 load to P_pick3' _+ p2 O0 ~1 a: n
end
3 l9 a1 }0 X  T% q0 ^# w# `4 X. j) E2 ]/ V9 r8 y
begin P_pick1 arriving
6 V. f: A1 N% ?    set A_i to 1
& L, ~: G7 I, ^$ D& P    move into Q_induct1
& `; d0 ^$ Q) E3 v0 R+ D    move into pickaisle.induct1# {  K0 c& m3 d3 v6 B% E* I5 a. W
    while A_i<=30 do begin0 F5 c# B  x( J+ d
        travel to pickaisle.con(A_i)
! o8 N/ C# c! V# M4 w( k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ?7 P1 D* H# M$ a. s; ]: ^! s+ K
        else wait for 10 sec% |" V. x" j4 X5 e
        if A_i=A_leave then send to die
7 I0 [0 i% ?9 j$ n3 |        else inc A_i by 1
: n  i8 C: x  _    end, Z% q( ?/ F" {! r( x! G; K
end1 U# m* [; u5 I. o: S5 C3 W: P
2 w8 m8 f3 K6 ^/ {
begin P_pick2 arriving
: u: g% O6 }6 R7 g$ \. L    set A_i to 11- a. R& r, t& t
    move into Q_induct2
$ f' H+ J2 e: a* T    move into pickaisle.induct2
$ e6 _; g8 j2 ?    while A_i<=30 do begin  S) H/ J+ b% M& T
        travel to pickaisle.con(A_i)8 I* R( K. _3 Q8 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, N4 k  `' ]6 S1 }! H0 D2 |$ J
        else wait for 10 sec& A3 z0 m1 \0 x! P
        if A_i=A_leave then send to die
: `" m7 Y  M3 l        else inc A_i by 19 S9 i0 }$ ~' W+ X
    end& C+ r. a+ M* ]& p( s/ W
end  V" h! X' w+ I% ?* i
+ @+ S" k% K0 T) L# e
begin P_pick3 arriving
0 p( u! D% v: k8 v8 u    set A_i to 21
# M  O! F" W, B9 T, Q- N    move into Q_induct3
4 M2 a6 r( p5 m    move into pickaisle.induct3
* M7 T# t: G- f/ t8 E    while A_i<=30 do begin
+ D* v- Q. u) P- y3 P% D0 j        travel to pickaisle.con(A_i)2 U) K& }" c; d" K4 c1 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 K/ J6 h3 v2 Q& z- T5 e        else wait for 10 sec
8 {6 C. \$ Q4 G0 w        if A_i=A_leave then send to die4 m+ p/ X0 Z( Y* G) K* n- ^( y/ s
        else inc A_i by 1- J& _' e* M  D: s' E
    end5 e  q5 b6 x1 N9 c. G2 T1 a9 X
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是个什么东东?3 L8 t' e0 X3 G$ g) L& f/ P, W8 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 ~$ u0 F2 A4 G6 |" F$ e* S2 o/ t
; y; {& C; A- n; yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" _( h# q' Q7 c
. ?5 o6 h( q6 u- u5 U' t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 ^$ z* m% z4 i! L6 y9 T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 z' r+ j: I& n8 A+ ?) T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 ~% `8 S) z7 T# f& j( x7 [/ J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  x) B6 n& j8 L/ z
begin P_induction arriving( c1 S2 c  l$ N
    clone 1 load to P_pick(A_induct)
0 g9 |* }; n1 G  p8 p0 Uend最大的系3 v/ l# `  g# |: A

; W* c+ u; w" K' Y, }$ T% `begin P_pick arriving0 X1 t+ |* o! J' [
    set A_i to procindex * 10 + 1
. s& M/ d# {1 N; F    move into Q_induct(procindex)7 C3 s* M+ p! B8 T+ f5 W: B( x4 r
    move into pickaisle.induct(procindex)7 x$ b$ A( [8 J8 v5 P, q9 n
    /*check the type of pickaisle.induct(i), for your last problem.*/4 r/ a$ D) t3 K. t+ m& P( T& g6 c* |

- c' C: }7 G7 c+ K    while A_i<=30 do begin
; K! c6 [. [2 ^0 J. Z; D( X3 x        travel to pickaisle.con(A_i)
6 |1 r/ x: A8 K9 g$ v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) |8 o* z6 y5 I. ^7 g        else wait for 10 sec/ _3 X# n. j2 Q' m! e( ^" j: a
        if A_i=A_leave then send to die
# a. L; ]4 T1 w/ e* P! @# V7 X        else inc A_i by 18 g* |, x$ ?' ?8 V
    end+ l, N/ H2 w/ u/ o
end3 W. w5 l, |6 P% O) B9 d. W3 }
- \. v4 L9 `1 e2 [5 h% X5 H7 H
其中的procindex为整形,代表当前process的序号。
( Z) {7 Q) G' e8 {- rstation和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-8-21 19:52 , Processed in 0.017903 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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