设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13334|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 |1 O1 L" h. M: o1 d
+ Z  Z( p& `; r: o+ ]5 O1 Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! g  P, z3 q' t$ i
& s% |2 t* |2 `
begin P_read arriving
6 `6 s" G9 _! o1 G! ]    while 1=1 do begin" m1 g& S2 h1 Y3 ~
        read A_tote from "data.txt" with delimiter "\n"$ s& s) L. x0 Q  |( l* G( k
        read A_time from "data.txt" with delimiter "\n"! ~8 @( C' a1 ~, o: M
        read A_leave from "data.txt" with delimiter "\n"
( J# ?. t( H( Q$ o- C        read A_picks from "data.txt" with delimiter "\n"4 _, @  e- A5 n
        set load type to A_tote  D* w: W( Z/ U. ^/ z8 b& f+ z
        if A_tote="tote 1" then set A_induct to 1: e0 ~, V* a0 l5 s! f
        else if A_tote="tote 2" then set A_induct to 2( n' ]$ n1 ?: f% c( E
            else set A_induct to 3   
, h4 c* _  k) k* N' V: Z        set A_i to 09 k) u# X$ ^" ^9 x& O( Q3 b* e! _
        clone 1 load to P_induction
: ~  e* ~/ U+ A* Y2 H/ [        wait for A_time sec
1 n9 q8 t6 _1 K; ~" @7 w8 L% Z    end
: G; ~  |6 [- G4 ?end
( ?* O. X  m: X- Q, _' n- ~& q1 ?) ^. O6 r
begin P_induction arriving  A8 n1 h. O# q7 D% M" K
    if A_induct=1 then clone 1 load to P_pick1  g) a: d8 u( {3 J, v% H$ a
    else if A_induct=2 then clone 1 load to P_pick2  ~9 s$ z, q1 x1 |1 o7 ^- Z8 d- b
        else clone 1 load to P_pick3
/ L& `' O) M! M+ H  Q3 c) u3 k. \end
$ d6 g7 @9 Y. D/ V  ^$ I0 T, [" K  A& q6 `$ i
begin P_pick1 arriving9 i2 S4 e9 G) \3 @  E1 N
    set A_i to 1
& @5 o5 x9 D9 V9 h    move into Q_induct1
/ {! @( C5 l; n1 S1 p  e6 m: m) w$ k    move into pickaisle.induct10 [; {+ N% k4 y5 j, q8 u
    while A_i<=30 do begin
) h( I$ ^/ \6 a, _6 A* f* G) u        travel to pickaisle.con(A_i)6 S6 S3 k5 `& Y% c7 {0 Z- Q( h1 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d3 c8 {2 D- H, H
        else wait for 10 sec6 n; W/ \* J5 q, E6 x3 K1 Y
        if A_i=A_leave then send to die% ~3 }6 m8 }+ B5 k* H/ m0 g0 Z
        else inc A_i by 1
' f( p8 V( M0 M5 \) c$ P9 u    end
, ^" N) D5 J% Pend: ?) i* k, ]2 E' o- F

4 v: V3 `/ X4 `$ ~$ i$ @begin P_pick2 arriving) `* x9 D3 s6 ~$ u, [
    set A_i to 111 @8 ?7 v! S- y& F0 p; I/ w+ N$ e
    move into Q_induct2$ |* u- h" `* g
    move into pickaisle.induct2$ J, q4 d) Q, R2 P. b
    while A_i<=30 do begin
. B8 T# K8 |& b$ g        travel to pickaisle.con(A_i)
7 B6 C$ x% t( U6 [. a, ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' I) |$ a8 B' @0 H0 u
        else wait for 10 sec0 H# j5 T5 {: C, \. R& m) M+ B
        if A_i=A_leave then send to die
2 z/ [+ c  `. T% R        else inc A_i by 1
$ M4 J2 [, C) i& C% _    end- ~+ `: m3 |. \
end% J; |& k/ d5 C* Z
6 j1 p! W! U% j5 T9 Z
begin P_pick3 arriving* F0 i2 R7 _. |/ }  J
    set A_i to 212 q- o9 U, Z# o$ A4 x. q0 x
    move into Q_induct38 ?! i5 g  a8 i& v% k
    move into pickaisle.induct3
0 E$ J( }! d( A/ m8 m/ Z+ M    while A_i<=30 do begin
  I0 r' n: w' n+ F0 j. R) X        travel to pickaisle.con(A_i)' l& d% F. ], D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! x! g. v- P: C/ ~5 K$ F7 c0 t8 Y        else wait for 10 sec
: b9 l' f$ ]7 v6 p" O3 w6 p        if A_i=A_leave then send to die/ a0 c- J; F7 }# X
        else inc A_i by 1
4 [% B' C% B7 {8 F) Y( O    end6 e7 J4 ]( r- L% q: B3 K6 m4 B
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是个什么东东?4 ~) W* |/ l5 b  \( I- e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! a6 W! z+ [' O; S! R! ~0 c: j" |; g( h/ u# |9 Z% v" j. K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 H7 M" l: I, q) z# g" C$ p4 I+ {+ p2 o- Q' s0 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( B" `. c, d( `! N% Z" S- I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 x; {$ b: y7 ]4 B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 {" E$ z* d6 {- g0 ]) g( F2 ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  P6 M! A0 I) a( T6 x
begin P_induction arriving
4 g: Q- ?$ q  e# @" O    clone 1 load to P_pick(A_induct)
7 @+ T+ m' _& o: f' `8 N. Z& pend最大的系
/ \  G) U, D/ r( Z. T+ x5 k1 H* K7 U
begin P_pick arriving
6 w" E0 x6 k# t0 k) I3 _# s5 a- j    set A_i to procindex * 10 + 1
- A' ^8 l) X: s% S& P) h) t4 Y/ n    move into Q_induct(procindex)  D2 Q9 c2 F% K1 ?. f1 h( I
    move into pickaisle.induct(procindex)$ |  z# v. u; {0 c% H  t' O
    /*check the type of pickaisle.induct(i), for your last problem.*/  n# U4 S+ e. a3 K% V5 C
2 S( U. z, J9 J7 m) @
    while A_i<=30 do begin- d# {# ]  n9 k2 \" b
        travel to pickaisle.con(A_i)7 S  U0 N! K% V: Q, K( {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. N6 k6 c) A5 R1 f
        else wait for 10 sec
9 O8 o/ x, Q0 x" |% Y0 X        if A_i=A_leave then send to die- ^9 \, O7 P4 s: Y9 k0 m! c
        else inc A_i by 1, {* h2 B: G+ T' G/ }- _8 D
    end- M( s: t" [8 u3 v. [& G& m
end
  U  u7 C1 {3 I# a& p. u3 q* L- s  P2 v: @: V4 c5 c
其中的procindex为整形,代表当前process的序号。$ A  |" X% i5 B, h1 ]5 Y
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-4-4 22:36 , Processed in 0.016249 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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