设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12147|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ C* m# B; Z! t7 u0 x
0 }4 S( A' c) o+ Y8 h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 b& p& K4 f7 b! ?$ r
* t) |7 W! B  f, _begin P_read arriving5 J* u# o# J; P. R+ S
    while 1=1 do begin
7 }" q* [9 @1 Y" m        read A_tote from "data.txt" with delimiter "\n"7 c8 M6 m# `) R$ C0 }0 o" E
        read A_time from "data.txt" with delimiter "\n"
6 G0 D; k) `) X/ H' c! o6 P2 x- W        read A_leave from "data.txt" with delimiter "\n"
* J6 j/ ~3 S) D/ S" A. q        read A_picks from "data.txt" with delimiter "\n"$ k4 A5 g  v) b( g/ }$ ^6 n) ~# Q% U( J
        set load type to A_tote
/ m8 v. M8 c5 X; L7 Z6 v  z        if A_tote="tote 1" then set A_induct to 1
4 x' z2 {6 a' \+ S& c        else if A_tote="tote 2" then set A_induct to 2; X5 ~" R! }  Y( `8 N0 T" F
            else set A_induct to 3   
  G* M3 Q( x% W        set A_i to 0
, S2 ]5 m% q9 d# R$ W7 ?2 l, R        clone 1 load to P_induction: c3 ^2 ^- a9 M
        wait for A_time sec1 @( Q2 n) J1 _% d
    end6 f+ P  y' C( s4 j* ?4 S& A
end
' n: v$ p& X+ d6 _% e" u9 }2 m6 I, V5 S; ?
begin P_induction arriving
, `7 J! k& T/ h9 Q/ ?    if A_induct=1 then clone 1 load to P_pick1
7 s4 L/ u7 J( r1 r. U8 T$ r    else if A_induct=2 then clone 1 load to P_pick2* B& P- D4 k$ L& f# ^
        else clone 1 load to P_pick3
0 x3 F3 T  k/ ~4 ?2 H6 b  q5 Y: Eend
9 D% o7 M) C( [, `5 Z. H1 k6 f4 F
% ~( v3 {+ p1 H( w% T4 ^) c6 ibegin P_pick1 arriving
  z. Z7 i& }6 ~8 w9 x# f2 O& L    set A_i to 1
0 |2 B) [7 {. _/ h! R. U+ h2 v    move into Q_induct11 e1 J' A) m3 P/ G5 a
    move into pickaisle.induct1( ]! z3 u, P  g8 L3 B% G& Q
    while A_i<=30 do begin
/ S4 F* |4 B6 E! C; l; i3 c* i        travel to pickaisle.con(A_i)
0 L7 L  e6 A; S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* j9 K: P. c$ f
        else wait for 10 sec% d, o* c, C4 v9 v2 u
        if A_i=A_leave then send to die0 p/ ^6 i" Z0 g8 c4 z
        else inc A_i by 1% Q! \6 b* V& e, P
    end
" y$ }! \, i. I1 ^( T- Nend2 H. s+ L" l( Y9 R

8 O% P# K4 f5 n: R$ r  [begin P_pick2 arriving3 A+ i. t* r; y4 z: _9 ]
    set A_i to 11
: e5 \1 X* ^7 `; }    move into Q_induct2
2 ?2 F1 t3 V; c$ l" T" ]/ j    move into pickaisle.induct2
3 W( T% c( j9 j# j9 l  e1 `    while A_i<=30 do begin
) ~3 S7 @6 G" ?( F  s  M2 x. y        travel to pickaisle.con(A_i)
) o" D  z$ a! c$ \* Q: i/ m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 y$ z$ }* J% ]; {" C' |' I7 a
        else wait for 10 sec
' u) {; T+ ?3 G& Z! w% U$ b        if A_i=A_leave then send to die
) ^: B: I0 J% x' K+ u        else inc A_i by 1/ ?; m# q- W4 p, Z4 i
    end2 b; ^6 b0 ?  Q6 t  c2 u
end+ C, c2 b' A" W* D5 I* j

; T4 ]# H5 a& q" jbegin P_pick3 arriving
4 q5 j% ~+ v! F( }$ d1 b8 N( \    set A_i to 21
5 H, D& S5 [3 D' N, N- w    move into Q_induct3
5 N+ b# Q! s+ r) h- ]+ ^) }# G5 j    move into pickaisle.induct3
  {3 \: ^- X6 E$ \# Q    while A_i<=30 do begin
1 Z* d  K  |8 m) P        travel to pickaisle.con(A_i)1 e( _' u! j, ~/ B5 s; h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z% \( J* c; R+ m
        else wait for 10 sec' B4 Y4 M+ M7 a9 {
        if A_i=A_leave then send to die8 r6 Q0 W" A: ^3 a. F
        else inc A_i by 1# ~- I. H( U, s; L" ]
    end9 f' w# o/ C/ C; ~4 ~% M
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是个什么东东?! L7 |  a, g: n: A  F( k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. o) R1 O* N9 A1 [# s3 l7 J/ f  Z5 ~, a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# Q! }) k1 B7 I" p" _2 t
8 C5 ?5 O' y6 c) j4 n另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 r! V/ C$ e9 c' B. E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, I* O% v; I1 t# m8 i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 y$ c, Y. z- A# T) I; E& B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 V  ^" t$ I  c- T2 v+ _begin P_induction arriving
4 g$ P3 \% u0 U4 e: H$ v0 W- U    clone 1 load to P_pick(A_induct)
' {1 ^5 Y$ r. {# x9 p# eend最大的系5 k# a9 t4 c$ N; q% W, j
5 Y% n& \( c0 b9 z7 d
begin P_pick arriving0 ~6 j, }) S, [# w$ R: U& A# Z* k
    set A_i to procindex * 10 + 1
: i: h2 m* y7 [    move into Q_induct(procindex)1 k3 G1 W/ o/ T) j/ d: E; O1 ?
    move into pickaisle.induct(procindex)
' A2 p9 ]# H1 T- c6 V( E    /*check the type of pickaisle.induct(i), for your last problem.*/
0 S0 t$ u, q; ?  [8 `8 \, J/ u( J
    while A_i<=30 do begin
7 M2 s7 M  V! r1 `        travel to pickaisle.con(A_i). N2 R( O) g+ F+ @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ i! K! }- p3 v2 f% I0 z
        else wait for 10 sec
/ e( z, p- c6 T3 y0 A. s$ O        if A_i=A_leave then send to die
  o. D. g& r6 e0 U- X        else inc A_i by 13 I! ~7 c5 g* }5 E  `. H+ i+ w1 i
    end  ~2 y0 V. e& I7 r/ z: G
end
+ k/ ]- a$ y. \7 O: Z1 A# Z3 f
其中的procindex为整形,代表当前process的序号。& K# R* r- H0 V9 ?
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, 2025-12-31 08:54 , Processed in 0.014937 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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