设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15307|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% p8 K2 G( G* o! b8 o
/ {( ?; @: _$ u# j我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% y2 Z" `7 s. I3 E; y; m3 y) B/ k; p# |6 T2 {
begin P_read arriving
, a; Q" X& L" k+ H7 H. ]  D    while 1=1 do begin
) k) F3 P# U( U/ Q3 ?% r        read A_tote from "data.txt" with delimiter "\n"
+ ^0 H1 A! j! \1 K4 @. d        read A_time from "data.txt" with delimiter "\n"
: ]5 B( r: C" y/ q6 s( S        read A_leave from "data.txt" with delimiter "\n"# `7 x7 `9 r$ a$ y1 z/ i6 ?9 j3 d
        read A_picks from "data.txt" with delimiter "\n"
. P% b+ g, x8 t$ B) j& [        set load type to A_tote9 Z7 i0 |: e( C' L- T
        if A_tote="tote 1" then set A_induct to 1
, q. B" g: S: ?/ P; X        else if A_tote="tote 2" then set A_induct to 2
3 c- C1 e' Q5 O9 d1 @# G, q            else set A_induct to 3   
( S- J; j- L/ [9 o3 P5 `. D% ~        set A_i to 0) s1 p- ]! m6 {$ V6 h2 Z
        clone 1 load to P_induction
" V9 C* _& R. O' `; t% L        wait for A_time sec
) ?2 {& \8 g1 x    end( o* V# W3 ^4 o6 g
end
3 n' I* ^+ `- C$ L1 N, q: f2 g% H2 m/ q6 a- i- L
begin P_induction arriving+ G8 y0 ^! `5 m( w. I+ Z( ]) t4 v$ b
    if A_induct=1 then clone 1 load to P_pick1( @/ ?3 e6 p/ k, D9 l+ B
    else if A_induct=2 then clone 1 load to P_pick2
8 m: q& O2 n( a" |' _4 X1 {& d        else clone 1 load to P_pick3# _. p6 }6 z2 q( ~# o6 q1 f+ O% X
end
% X6 G! R1 T- N; `4 l" _5 r& |  t, g) ]. p5 R
begin P_pick1 arriving
0 a: Q0 b( _; g( `    set A_i to 1. ~2 {% k: v* Q1 H/ B/ T( V
    move into Q_induct1
0 ~8 f$ ?6 [% J# C4 C, b    move into pickaisle.induct15 m4 U  T: [; J" U5 d3 |5 F
    while A_i<=30 do begin8 V% k: p$ o$ W. }+ A; Y2 B  o# C( c
        travel to pickaisle.con(A_i)
: ^8 n5 N! y  m8 ~, |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" R2 ]! k4 n3 U, B& _" @% z
        else wait for 10 sec
- O- ~) e" \& z# @: v        if A_i=A_leave then send to die
1 D- l& _9 \/ B! x5 i. S$ S        else inc A_i by 18 b% X6 H5 G$ W3 A
    end, L3 z" f8 Y4 e5 A( c: j% ~' V
end+ V- P, J, j: G9 V
7 e, z- T4 v& {) J  b- U
begin P_pick2 arriving& l. X: e& e/ Y' P4 P
    set A_i to 11
' Y+ b! q  V  e+ R1 j    move into Q_induct22 f1 h1 W1 u8 M' v: K! s
    move into pickaisle.induct2
- A2 d# O- ~* L) G8 j; ?6 M    while A_i<=30 do begin6 h  v" u. Q1 a3 {
        travel to pickaisle.con(A_i)" z  u( N3 T# o. g2 S. ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~( b( [+ p6 m7 v" f
        else wait for 10 sec  M7 K. o) t& K5 z* l+ j2 m
        if A_i=A_leave then send to die
4 o6 N* Y9 S8 F+ Y5 a5 n# \        else inc A_i by 10 ?# {( q1 I/ n+ U- I  s
    end
1 G; W( |2 k0 c. `8 k9 X0 hend+ A. b& i7 e1 `1 c: z
/ G5 h- F' V2 r# S! ?8 C
begin P_pick3 arriving8 @; \5 J5 Y$ O
    set A_i to 21
- U# E: ]% Z, y1 W# x7 |" a2 F. V    move into Q_induct3
0 }, `& L" L$ n# {; ]& M    move into pickaisle.induct3
) S9 J9 ?8 U9 P0 _7 b0 o& J    while A_i<=30 do begin: u+ V$ ]2 C# \$ M4 Q# L" g$ Y* U
        travel to pickaisle.con(A_i)
7 g/ P1 G9 A0 S% J; m; r$ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& l1 q/ {1 i% h' e$ U& V
        else wait for 10 sec
  f( F$ I6 `; s% h7 w, t) T        if A_i=A_leave then send to die
2 s% w" _$ V# {        else inc A_i by 1
% C( x4 W) e* B" M, y9 o. X0 m    end
9 m' r4 o7 f8 f$ y8 |7 X2 Y1 u- pend

最佳答案

查看完整内容

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是个什么东东?
* P( Y4 E" f- u. xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( Z5 x+ X& ^3 W) Q
) Q; A0 C- r, d0 q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 N% c) d/ W; \3 b2 j
* M4 q2 `; N4 Q. Q8 N
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  ^. X! I+ U; i8 X4 M1 E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ }* b7 @! {. P! T3 X6 }2 K/ [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 O' a, x% g' U5 `& I' y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% C) q6 N) T& b) p
begin P_induction arriving0 J+ G( T9 d7 [3 H' g! ?! N1 d8 g. g/ Z
    clone 1 load to P_pick(A_induct)& J# {4 \) T3 T7 i
end最大的系, C3 S- Z8 Y3 M7 m9 s
# Y- o' \# L( |" B
begin P_pick arriving, Y8 p" H- X2 p: ]1 B
    set A_i to procindex * 10 + 1% f" I" M# w5 I  ^0 J0 e
    move into Q_induct(procindex)/ `( ^) e% ~" R' \) W. Z
    move into pickaisle.induct(procindex)8 I! `2 J' m. P* ~
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 n7 P/ d6 G# m7 l& \- @! J/ X3 e4 ^2 p/ z3 e0 @
    while A_i<=30 do begin  b7 K, q% E% c9 u& X& i! L  Z9 e
        travel to pickaisle.con(A_i)' ?5 ]" g6 P; f" L4 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 U1 _( m4 p" M, b* U        else wait for 10 sec
1 v9 B, {+ l% [        if A_i=A_leave then send to die
% M! m: V* Z; b        else inc A_i by 1$ R' o6 g! y- [2 L3 U
    end
% s2 @$ L% h7 x5 w) E, kend
) N1 Z4 X! b; p7 U
1 K! B5 x) A* t$ b/ q+ Q其中的procindex为整形,代表当前process的序号。! S2 T2 c3 b  t* O+ {
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-9-1 01:56 , Processed in 0.014679 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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