设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12875|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( }, l( C3 Q1 C6 S$ I
9 l$ E  G6 j: [) \3 F8 u& 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中的数值,不知道会不会有什么不妥。
5 F0 K: b0 r$ o5 z6 f( D# P- q9 s1 i: Z
begin P_read arriving6 K% z! U+ E4 G
    while 1=1 do begin. v8 Z  _) t, y( e5 y
        read A_tote from "data.txt" with delimiter "\n"$ m9 l* \4 F" O/ C8 W
        read A_time from "data.txt" with delimiter "\n"
3 @8 J+ D8 J9 ?4 D        read A_leave from "data.txt" with delimiter "\n"
: K: _( R2 H0 I        read A_picks from "data.txt" with delimiter "\n"
* K- y, z: p# ?! `0 k        set load type to A_tote4 ~+ O, ]  G( O6 T* M- j0 i+ u
        if A_tote="tote 1" then set A_induct to 1/ ^/ e5 h+ i. I* m/ t. \
        else if A_tote="tote 2" then set A_induct to 28 [3 W1 Q, W8 b8 K5 ?9 N
            else set A_induct to 3    4 @4 d& y8 E: `  ~( F
        set A_i to 0& g" E5 v9 E1 H( i  Y: F3 [, u
        clone 1 load to P_induction7 Q/ [; z/ v/ \+ {) g# `
        wait for A_time sec; `, L' @2 I, Q7 V5 w/ ]& S5 N
    end+ Y2 x, t) H6 k( l8 A/ s; S
end& J3 D( w2 n/ ?# n$ A8 `2 ^

7 w" a4 L1 A* q7 A" xbegin P_induction arriving
! ~7 J" J  s# i2 `  \* a    if A_induct=1 then clone 1 load to P_pick1
& L. G! Z. ^0 q( x  \! e: a    else if A_induct=2 then clone 1 load to P_pick2
3 e0 }. W5 h" ^# b+ \5 R! ]        else clone 1 load to P_pick3
/ ^# c7 P' P) O$ U6 Y# F% P0 Nend; X. }# G0 h* d& Z' R; O
1 r  m$ h  r5 J
begin P_pick1 arriving" b$ N! K" `6 }% p! O% r7 C4 P
    set A_i to 12 a9 H1 S1 g9 P: ~4 y
    move into Q_induct17 p1 ?) N6 c, n  Q; ~! j/ d
    move into pickaisle.induct1
; K: P7 W6 w3 r( P, T3 o% D( J    while A_i<=30 do begin" P, y& {1 T7 W& z
        travel to pickaisle.con(A_i): H. ~6 @0 S1 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 m/ {* a; }, Y1 R+ \* Q7 @
        else wait for 10 sec/ Y$ f1 f% P( k$ {( ?3 y3 |
        if A_i=A_leave then send to die
) k# K" p1 V% r( l3 J7 u        else inc A_i by 1; ?6 q2 w( y$ }# q3 Q
    end* D! E5 v+ e+ P; T0 k
end
+ Y% w& Z. a7 f0 d$ d: Y" p1 f( H  t
begin P_pick2 arriving7 L" r& P* W1 Y. _! Z  K( E+ {
    set A_i to 110 |4 ^$ x# t8 j9 G  N3 z  z9 |
    move into Q_induct22 \. g% ~9 I3 s) K. _2 V3 W
    move into pickaisle.induct2" H! a3 Q) d5 E' Q) d
    while A_i<=30 do begin
- L% ^7 p/ g7 b% L/ Y        travel to pickaisle.con(A_i)
- j5 b7 C3 o6 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) t. m9 ?3 Y" r/ D% w+ M        else wait for 10 sec+ x3 F/ A+ r2 Q& j- t- Q# \/ g6 {
        if A_i=A_leave then send to die1 K8 A& S7 t1 f" i5 j  {7 }
        else inc A_i by 1
6 A! g3 d& d- n) t  j$ ?% v    end, M* e+ g' ?$ {
end; W  G* a3 z9 L$ x; q) B
4 l* [8 E5 W5 b+ X6 Z- d. Z5 Y
begin P_pick3 arriving- u6 w  [  {4 D; ^9 W
    set A_i to 21
5 t% V7 h5 ^4 X4 x, e& L, A    move into Q_induct3
+ p# k$ S' H8 c. [# k5 x$ \    move into pickaisle.induct3
; H4 g, u( B/ g% Y2 R& z/ I    while A_i<=30 do begin
, w  C" l8 F5 H; I% R! m        travel to pickaisle.con(A_i)& O% R' `- T; k( v! A4 B* P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 e$ H' Q3 k. p# Z+ ?9 g; P" ^
        else wait for 10 sec
  N* J! s1 C) s: g2 R        if A_i=A_leave then send to die( O3 u& I0 R# n( c& T9 `7 X
        else inc A_i by 18 o/ v' t/ {! T& J) j! e1 v! s
    end, K- A5 Q" a1 Y. ?& N7 ~. z
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是个什么东东?! r# c7 v% f% z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 ?. |0 b+ X9 e$ p9 ]9 q
0 A2 V7 l' e2 C/ a; y: p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  @$ `8 [% Q! m
% M: x  h, c$ H) w1 }! N3 I0 b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ I* }* {8 D! E3 A6 z, ?) N( m/ w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. s0 x4 D( t5 `! p, t3 A8 J& M& o, q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ Q0 l! N! m. p2 V9 w# {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, R* t/ i6 p. A. Z& W, W! A7 M
begin P_induction arriving9 D, x. h6 x1 q6 T* `! p
    clone 1 load to P_pick(A_induct)
6 _+ F- G& Z! r$ [1 `5 s( X" Jend最大的系
: C" C# j7 J- S3 k4 b: |2 v; ~' ?& l' l9 s
begin P_pick arriving
4 e* c% z2 Z4 J: G/ s# m, e    set A_i to procindex * 10 + 1
( N! V2 J$ ?9 Y7 y# F' [  {* x    move into Q_induct(procindex)5 O* p: [% o, n" m% n( A# q
    move into pickaisle.induct(procindex), K9 ?; D6 @! E. ~' X8 p
    /*check the type of pickaisle.induct(i), for your last problem.*/
' t7 G4 E, H) [6 k2 x: O2 D' N
1 ^! ]' ?# U& s1 J    while A_i<=30 do begin# m/ u; }- B, U+ ?+ ^0 X% T/ b
        travel to pickaisle.con(A_i)
. ~, v( Y" h) j  F7 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 v! m0 A6 q+ @+ V$ V! s
        else wait for 10 sec
( b* k" v4 k- j. ~0 k' |, R        if A_i=A_leave then send to die
! ]: q0 `8 \! J7 L' X        else inc A_i by 1
8 w  W0 a; {( X* s* J    end$ W& ]( S1 ^/ \# P- N$ l& P% B
end4 Y2 g' U% n; }0 A; u8 d- p

) I+ U: R% J7 ?! T其中的procindex为整形,代表当前process的序号。& g4 [2 _+ v7 T6 ?
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-2-26 20:44 , Processed in 0.017622 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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