设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14075|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 n' a3 T- }- B+ s
- l) c1 t2 j7 _: M  D, W; D1 U3 P我的问题是,在每个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中的数值,不知道会不会有什么不妥。# @* s' A9 i; A( L* d0 [9 l+ j

3 X# p  o$ S  o! u7 ?( R" ?/ X* wbegin P_read arriving& e7 {- _& ~% e% ?
    while 1=1 do begin' W. V2 G& y9 e! G) G
        read A_tote from "data.txt" with delimiter "\n"' W. t) E) i4 u; z+ ^& i# y0 d
        read A_time from "data.txt" with delimiter "\n"# J- c* o! V7 i  O1 _$ Q
        read A_leave from "data.txt" with delimiter "\n"" T/ I6 c% {) I' ?- `3 ]
        read A_picks from "data.txt" with delimiter "\n"
. c- j& U& }+ c+ }% Z' U        set load type to A_tote
% D, @, T& U" f" s5 d% W        if A_tote="tote 1" then set A_induct to 1
. Z& f+ Z; I2 o) e        else if A_tote="tote 2" then set A_induct to 2# \+ r& ^1 q+ M% r* c
            else set A_induct to 3   
) w  H; w& O8 j% D, r) N6 ?        set A_i to 0! O2 I, i* _, O+ t9 c$ ^
        clone 1 load to P_induction" j8 D* Q1 X; ?3 d5 \
        wait for A_time sec: M4 \- s6 o7 n! f
    end# r! t/ R  `7 k1 g7 e& @
end
. \( _$ l  r! e+ ?; Q+ c3 R2 w
& i" s4 I; S$ N* Cbegin P_induction arriving
7 L$ S2 r: U0 s% T6 t& _$ ?6 E    if A_induct=1 then clone 1 load to P_pick1
, }9 S& M- p, @2 f( N" q    else if A_induct=2 then clone 1 load to P_pick2+ L$ g: D# f  s% p, W
        else clone 1 load to P_pick3
) ^/ I$ C% u% a9 uend
* o( V. {# d, D; f2 z$ u6 Q; X2 w  O2 P6 H2 y( S
begin P_pick1 arriving
1 S! T* n2 H- y8 o" R    set A_i to 1
: [! B% A2 @" r0 T" n+ g2 }    move into Q_induct1
& H% a3 P  X# {% c& f3 z    move into pickaisle.induct1
$ @; b0 X& x; l/ I0 ^3 J, A3 T    while A_i<=30 do begin
! `, Z+ `0 U/ A- E        travel to pickaisle.con(A_i)* P6 u5 _! b% L# @* U2 ~+ d# d+ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ t3 V, H4 F7 _" O5 Q( o        else wait for 10 sec/ C% S; ^8 E( _& [) f" _( t# `& m
        if A_i=A_leave then send to die
9 U2 B5 S9 C5 Y" V" S+ p: F8 M$ U        else inc A_i by 1/ [/ Q# C* i6 q9 z9 F" @' m
    end
# c# e& q; ~3 r* fend3 |- C1 S9 T. f) N9 R, Y  a( n

3 G; E6 P2 }+ i' ^1 r& H; V! K( y$ qbegin P_pick2 arriving
; n$ s8 o, S( I0 `' \0 o    set A_i to 11
- }* n& q" @3 I    move into Q_induct2
* p; G2 \, k3 Q+ a5 s    move into pickaisle.induct2
& b' Z% F( x1 k% u    while A_i<=30 do begin! r5 ^. r- {  m
        travel to pickaisle.con(A_i)+ _9 z/ i2 P  k; x( B2 o$ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* Q& b$ K6 A2 j7 e* V
        else wait for 10 sec
$ j7 z6 b4 f( V' z) |$ {, N        if A_i=A_leave then send to die6 U  n1 X! Z1 h( i+ F) R: C
        else inc A_i by 1, c$ s  D( f  n0 r, t
    end
1 W+ X1 H/ Y" g, ~end) O. F' T; T* J. ?2 \( T* a% y7 z

9 z2 C9 P& C  u6 h% d1 @begin P_pick3 arriving
( f% Z8 B- \! ~    set A_i to 21
, J, F1 W" L3 U& y, q    move into Q_induct3
% G, a8 t; K- M3 \2 L    move into pickaisle.induct3  H% d- N/ b% R4 Q
    while A_i<=30 do begin# Y9 ]. E9 A0 j7 K: k6 m. _
        travel to pickaisle.con(A_i)
7 L$ L1 W3 l7 ^  Q6 L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: `  ^( _$ p, [. a" p! c, L- a
        else wait for 10 sec
4 c( {; b6 W0 t8 n$ s        if A_i=A_leave then send to die% @4 s+ f& u% v! v- K
        else inc A_i by 1$ w0 V% {1 J' ^0 E. E. u% b8 x$ {
    end
+ Q8 Z( h( o* @( u3 m- {3 o+ d" Oend

最佳答案

查看完整内容

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是个什么东东?
7 t7 H  r' ?' smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: [- F& B  P1 t8 H$ M. Z* F
* G/ S! q+ r! C9 s0 H' a3 e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 w0 S! C; V1 K( c
% W, W4 N  @- j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ i) `$ ~* |3 E  i/ [5 ~7 w9 w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 o" D$ ^0 D8 @* |$ c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( W+ I4 m2 O: i5 z* ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, N) t" [! n/ T% D
begin P_induction arriving5 J: k: l0 {8 h" Y% ]  K9 l+ {& N
    clone 1 load to P_pick(A_induct)
5 `* N6 B: n- G; \end最大的系
3 r5 i/ W/ l, P+ e4 y. l" W$ d5 D3 o4 d- E
begin P_pick arriving' k* Z6 {" ~! Z9 [( _: g- z  s
    set A_i to procindex * 10 + 15 R  i  l. a  ], u; _
    move into Q_induct(procindex)
1 t0 B0 t1 H# F$ G; |$ T9 ~    move into pickaisle.induct(procindex)
5 D0 h3 a$ Z. P4 Z7 d    /*check the type of pickaisle.induct(i), for your last problem.*/+ B1 W& @2 ?3 q4 x7 t  [

1 Z, f' `6 P2 b1 ^    while A_i<=30 do begin
% v; f6 A6 X4 C% A1 k& p        travel to pickaisle.con(A_i)/ u! k, c3 U6 e/ U& g2 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# [! }( y+ _& l, q
        else wait for 10 sec, D. @# ]4 B' Y/ M! |2 ^* g
        if A_i=A_leave then send to die3 A) x+ `6 R; F# L; D4 ^8 e
        else inc A_i by 1
& z6 j7 v& l2 ]# l# }) ?3 c    end, z! C& C0 T5 {- y
end% s1 t- V: }3 y* Y: v" Y
6 r/ U  b( \/ L" m2 u$ b  n6 l# c  V
其中的procindex为整形,代表当前process的序号。+ Q) U7 L* K* T+ B+ l
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-6-6 02:50 , Processed in 0.015699 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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