设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15165|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 Q4 I0 H: C: r3 @0 ?$ F" _
1 |. _7 f( \8 G& e我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 n/ Q( Q2 A+ g- ^/ s  R

1 C5 K: N( f1 O; n4 h! @7 }begin P_read arriving
! ]8 o9 D  W% J0 Z- `1 X    while 1=1 do begin
+ @% z0 Y# k) F1 N: t1 f        read A_tote from "data.txt" with delimiter "\n": F: Q( ?+ h  t" ]$ }- P
        read A_time from "data.txt" with delimiter "\n"
9 k" y+ u3 P- |) w! x$ K/ ?$ Z1 P5 J        read A_leave from "data.txt" with delimiter "\n"9 n: s) ?! A! s) Y: w6 T! R+ h
        read A_picks from "data.txt" with delimiter "\n"
6 r0 Z+ P; \& a& b0 K) @        set load type to A_tote* j( D! y, q" l, p
        if A_tote="tote 1" then set A_induct to 1
7 G' P! h, Z9 @% B2 `" \        else if A_tote="tote 2" then set A_induct to 2# ~5 a; q, A/ w" H1 Q; t# e! p& ^
            else set A_induct to 3   
+ Y$ z& W9 d4 x% W/ S, k9 y2 w        set A_i to 0
5 ?4 ]) B9 j/ ^$ P& v! |# l        clone 1 load to P_induction
! r, E1 ^+ o4 \' i2 a4 X        wait for A_time sec
+ @. u+ [, P1 W& T( w; l' ?    end/ @( b6 Y: x& \+ p$ e
end
9 w8 w$ _7 Y. i
/ p5 l$ _& c( mbegin P_induction arriving
: P1 ]$ Q0 y; T- x0 D! Q  W    if A_induct=1 then clone 1 load to P_pick1
! K6 S# v6 A+ u3 |/ m    else if A_induct=2 then clone 1 load to P_pick2  W, }$ h2 A4 Z4 Y5 j4 @
        else clone 1 load to P_pick3
" e# w  J4 I3 s( G! n  Cend1 q; _0 C% O- V2 d- t  O' Z
4 l2 l3 y# }2 U# A
begin P_pick1 arriving. T7 n+ s8 S& }* B; A+ m, s8 [0 {
    set A_i to 1+ r( i5 h0 l, Q* G
    move into Q_induct1' }3 T7 T# Z4 n1 b' u
    move into pickaisle.induct1, ~, p% f3 v7 f1 c: c1 V
    while A_i<=30 do begin' ?" E4 ~9 @( R6 R- Y7 i
        travel to pickaisle.con(A_i)1 I# j2 y& O8 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 ]2 o! k- o) c        else wait for 10 sec
9 R! b6 H/ v' [/ y        if A_i=A_leave then send to die. V( F, c1 i* P* u+ L
        else inc A_i by 1
+ E1 \: r; y2 d( I+ E& [  V+ {    end$ y* @$ `( Q4 N, V2 |- A
end/ m/ C" r/ v6 [2 g5 w7 v5 Q  W

% F" @$ |2 y0 h& `2 i2 @begin P_pick2 arriving" [% ^0 S! n5 G4 M+ I4 Z/ j$ C5 u" k
    set A_i to 113 c- R2 _8 u9 G
    move into Q_induct2
+ Z$ p5 ~- ?/ A  q/ A    move into pickaisle.induct2
/ s. i3 e# {# F0 R$ X) i6 m    while A_i<=30 do begin
) t7 v* l+ _. n+ h" ~, D& w        travel to pickaisle.con(A_i)8 w8 t' q% Q& R, Y- w9 ]3 m  E; f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 D# o2 d/ v: |" W        else wait for 10 sec
3 e: P5 z' Z/ t% [" Y* a1 W& ~        if A_i=A_leave then send to die9 f4 s% A3 B' A
        else inc A_i by 1
/ s2 y- w( y! A6 I' |0 p% X    end
1 Z- {" B/ t* F) Dend1 l/ ^1 R" _+ P) Y; [$ L
- v5 q: _' j+ j2 d0 m
begin P_pick3 arriving2 q6 g1 c- x; `6 M7 M
    set A_i to 21
- x" F0 C, J. U    move into Q_induct33 }( h  e; Y0 H& n% W
    move into pickaisle.induct3
3 \3 ^! s+ |! Q( P, E    while A_i<=30 do begin
" _; ]5 }+ m- T! E. R5 }1 a9 a) ]' z        travel to pickaisle.con(A_i), X7 j, m, n7 n% S5 u" f: X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ q! V2 A" R3 d' }0 H. K  c$ m        else wait for 10 sec
" Q1 A3 c! T' L        if A_i=A_leave then send to die
& `% w6 ~# o8 v( w        else inc A_i by 1( L$ Z3 f. I0 i2 D( Z: Y8 t
    end2 L) q( u& ~0 A; C2 k4 R3 |
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是个什么东东?$ J( ~$ s, v$ s. ~9 f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: i8 Q. N; l8 [! U$ U
* d. O4 D8 K! T6 Y5 d+ |! g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; G: T$ e1 }1 O6 T1 Z. _4 ^( b3 j# v  p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ }  K$ _# r! |, w7 ~3 z- y& U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% \( o+ V3 ?3 D# P; U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 I( d; b3 [  x2 \/ S9 e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 g1 _" D/ v0 x& Z
begin P_induction arriving( I1 o: X" P9 j- q
    clone 1 load to P_pick(A_induct)1 N) W# d. h, y% y; c1 o4 x
end最大的系: s% B3 z) U6 i. N) j
7 E0 Z4 W/ I- j/ Y! v8 m, a9 G
begin P_pick arriving5 S# j8 h& ?$ t+ o! e6 @
    set A_i to procindex * 10 + 1* L% |% U8 b: A0 o. x
    move into Q_induct(procindex). z& ?) T& o1 D0 {+ M' j
    move into pickaisle.induct(procindex)
/ b8 x1 G5 {$ b    /*check the type of pickaisle.induct(i), for your last problem.*/
$ C+ u6 b: Z2 l5 C# E3 ]) E+ t* f+ `+ U: I3 [) X  T6 c) s" F. X2 G
    while A_i<=30 do begin
  x/ F# P% i% Q9 I0 F1 M9 q        travel to pickaisle.con(A_i)* E7 d0 O% x# j" r. n7 q6 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& ]  h' x# T/ k4 Y* [6 W7 x
        else wait for 10 sec4 s- L* c  j5 w! F9 {0 v! J
        if A_i=A_leave then send to die
3 h# H& T! o9 b' f; Z- w3 K5 E        else inc A_i by 1
3 ?+ a+ z# y7 v; U2 W    end
# T$ R1 @9 C) R1 a/ F0 V  _2 O3 iend. i! P; x, x/ ]9 v

3 ?7 a6 S# c, `5 e% x$ a- a其中的procindex为整形,代表当前process的序号。7 [( N7 E  b1 r  l; d
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-8-18 03:41 , Processed in 0.019282 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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