设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13961|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 @8 ^8 T6 ^2 a; j( H# X& `5 y& F2 O
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( J3 H# F  W* W$ o, y0 Q
: D; p- D+ ]& a  k* K% }: s/ X
begin P_read arriving
0 @3 f: E0 v- N) C    while 1=1 do begin5 F& J1 p& X; l7 C
        read A_tote from "data.txt" with delimiter "\n"
9 q7 r5 K$ s% k3 p+ I, v: q        read A_time from "data.txt" with delimiter "\n"
5 o! P/ o# V/ F9 `        read A_leave from "data.txt" with delimiter "\n"* d( d! @- T1 m1 T8 @( D/ x6 w
        read A_picks from "data.txt" with delimiter "\n"1 }. A% L& u6 U
        set load type to A_tote4 x4 I/ l! E* q
        if A_tote="tote 1" then set A_induct to 1) V; L5 ?& m1 d/ V' f8 {5 T. _0 C
        else if A_tote="tote 2" then set A_induct to 24 f% B9 G! o/ R# t" _( S
            else set A_induct to 3   
9 m, N7 I& h7 E1 z7 H) a! R7 Q        set A_i to 0  P$ Z) O+ w2 T1 ?% A
        clone 1 load to P_induction6 t& L: B$ h$ K3 l9 I9 ?, Q, B
        wait for A_time sec, g8 L5 |6 g) O1 g9 y0 t+ h6 O) c
    end
* U( o' Q  U. `+ \9 Qend
& r. x3 F0 ~5 C1 `3 t& d: y2 y- w$ m/ _+ F
begin P_induction arriving, @2 s$ C# n# D. T
    if A_induct=1 then clone 1 load to P_pick11 M5 `6 T$ j/ t% n, q
    else if A_induct=2 then clone 1 load to P_pick2
8 T9 y* J9 h9 D) ?+ ]        else clone 1 load to P_pick3
9 @1 }% b( j7 W4 m; ~end( i1 X5 M% t" {# u3 c
5 A' O! u. F1 d
begin P_pick1 arriving
* z2 p/ \7 F( D, b6 b    set A_i to 1
9 O; A) R2 h. J1 N    move into Q_induct1
  a' Q' Y& i" o6 B    move into pickaisle.induct1: [$ b2 N/ {1 I. Q% B
    while A_i<=30 do begin& B8 O) t" t/ k7 M( w. P' R3 q/ }! ]' j
        travel to pickaisle.con(A_i)) o6 \6 r+ d6 y! |* I0 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 k4 `  H; {! z& A8 J, T' S        else wait for 10 sec. i: J9 X$ V4 M- r* F1 y
        if A_i=A_leave then send to die$ R- w0 f0 l  _
        else inc A_i by 1$ E$ q' c$ i2 |; C
    end
! e0 G, M2 M. S# n. m9 X! n0 s+ Rend
9 G6 r2 q* C8 o+ ^+ z
2 X3 W" ^4 A4 b8 \6 Bbegin P_pick2 arriving
4 |! _: L6 Z' [9 J: x( N    set A_i to 11" x/ Y9 I/ M* h1 O$ f' ]8 [
    move into Q_induct2
" k6 g* q4 f/ e$ \) E    move into pickaisle.induct2; i6 J& ^; Y; {, u
    while A_i<=30 do begin
( O. `8 s- f- w9 v' a' M        travel to pickaisle.con(A_i)
) M* c% z5 J1 Y! {" |0 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 p; i& x7 b4 z$ A
        else wait for 10 sec
0 Z$ G/ l) {8 Z" G6 [* h9 w7 u        if A_i=A_leave then send to die7 X( J7 s# V. M" r7 I4 @% S
        else inc A_i by 1% G; a) d! ~# \8 I: }; e
    end$ y( L5 }  k2 G6 o1 K# D/ k) ?
end
1 h7 f* V/ u( r' t0 S, y; }- y/ _7 A/ G( ?7 i. K$ \
begin P_pick3 arriving, H) z2 |& s7 m6 a2 b! e( w
    set A_i to 21! Y7 l/ ~( ]& e! A" ?' e1 S1 C
    move into Q_induct3
' x- x$ C" ~) P6 e/ K. [0 Z9 f    move into pickaisle.induct3
0 t- m9 w  {: z% w    while A_i<=30 do begin
- x9 h: e( \8 L3 ]; J# X$ M. s2 Z        travel to pickaisle.con(A_i)
- _0 r, _, ^$ {: g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X  _6 p, Z4 \; Q        else wait for 10 sec
! A1 L& ~7 a" s& ^& E1 \        if A_i=A_leave then send to die7 t5 _( N) X3 [0 W; X
        else inc A_i by 1
1 D- l' N5 w6 p7 ]7 R/ J  Z# L    end
& f' ^0 S, q7 ~' L1 Z) P! Vend

最佳答案

查看完整内容

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是个什么东东?
. l6 O6 E" J0 Z" A( Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 F$ i9 i( d1 r( Z3 N0 n3 k% h% f# d; E0 i! \: w, w/ P. m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; J6 c6 b; ?8 {7 M4 p0 z) M$ x" H" V7 j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% l8 R' Q* E! |- g2 E  ~+ d4 V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* P6 R2 j& k! y6 P- W2 U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 ]4 F* q# z! G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) f! V) U, ?6 Q# O. ^$ j
begin P_induction arriving
# L0 g: `/ q2 u8 x, s- T; C    clone 1 load to P_pick(A_induct)
, S) ^  l& ~5 s% U, c8 tend最大的系6 a, f( I. u' z( Y" b) h

+ W$ Z; [/ ?/ Y; J% Rbegin P_pick arriving
+ x4 Y1 E7 r1 k    set A_i to procindex * 10 + 1* {" ?3 m- \. q* k8 {5 Y) E
    move into Q_induct(procindex)
% {" J5 S- D% L- D% V    move into pickaisle.induct(procindex)/ }) I- Z0 P+ U' v
    /*check the type of pickaisle.induct(i), for your last problem.*/
  ]4 l1 U/ P+ B0 h0 y: v5 [' K$ ^
& S: j* `+ a3 g2 F    while A_i<=30 do begin
. A, w2 ]  ^, s        travel to pickaisle.con(A_i). b5 }4 @2 C( _  X# x& H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! V1 u6 b$ h2 e( \; M- h
        else wait for 10 sec
% d7 A* j6 {8 q2 N( X        if A_i=A_leave then send to die/ P' r; f3 e9 G3 Y6 \9 e
        else inc A_i by 1% {; H/ J6 S) y- `8 D) p- Q* }
    end
8 h+ C# d4 a; l7 Q: eend
( ]9 R$ Y! {4 o4 s+ u4 o; O
; \/ d  j6 y6 `, {, a. `其中的procindex为整形,代表当前process的序号。) s% E- w& h* d- s
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-5-25 04:48 , Processed in 0.017859 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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