设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12657|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 z* B) D0 [5 t# |* U: e9 |

2 H; x8 S6 @# A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ ^; R2 ^! ?' l1 F) H8 j7 `7 k, U$ ~$ c1 {# v& p
begin P_read arriving* ~7 ?$ m5 S0 G* G
    while 1=1 do begin9 Q' }5 ?7 Q4 t) G' _$ x
        read A_tote from "data.txt" with delimiter "\n"* p+ B7 ]$ K4 ?* g- ^" X4 j
        read A_time from "data.txt" with delimiter "\n"0 Z% ~1 q. u' a- |. N
        read A_leave from "data.txt" with delimiter "\n". }) {: I6 z, m4 h, M/ t5 D
        read A_picks from "data.txt" with delimiter "\n"
9 Z) Z/ C7 B$ d# i5 L! F        set load type to A_tote0 L9 l6 U; l# [# \
        if A_tote="tote 1" then set A_induct to 1; y8 N# e# R% N9 x; |) r5 e& F3 L- f
        else if A_tote="tote 2" then set A_induct to 2; U  y( y7 w3 v. T& x
            else set A_induct to 3   
4 x0 J0 {. d9 O2 h' s0 T        set A_i to 0
+ I7 E) q6 d" X, t7 ^        clone 1 load to P_induction8 [) P. o* T8 l5 t6 C$ \
        wait for A_time sec  V, A" C. O8 a1 O: A5 r& i. z- H4 c
    end
+ s, O/ u9 d2 Mend
7 m1 k2 E- \6 j/ v0 l  A0 ^( A2 O( ]+ |6 Z+ v
begin P_induction arriving0 k, f+ C3 @; a3 }/ C6 s. _. O* Y
    if A_induct=1 then clone 1 load to P_pick1; ?. r  B$ S9 D( T- f: k0 ~
    else if A_induct=2 then clone 1 load to P_pick2! ?( q- h" _; M+ ~/ }
        else clone 1 load to P_pick3
/ k2 [8 e: q- R, x8 W6 h2 pend
) O) U$ j2 @' }. \% a& C' `
9 B' W  M0 X: W+ _begin P_pick1 arriving) w( T- R! }7 G) w, R! [' G; p( H
    set A_i to 1+ K/ r8 c& l! [3 E
    move into Q_induct11 G/ \; s6 W% }& ]3 Q
    move into pickaisle.induct1& q0 ~, [  g& H  {& Y
    while A_i<=30 do begin
; ~, o' F3 \/ O: a        travel to pickaisle.con(A_i)
( X/ j6 H' R( [# \3 @5 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, C* P. P; Z$ y- V        else wait for 10 sec* k+ {* `- H6 }
        if A_i=A_leave then send to die
" a, _$ g1 t4 o" a( @5 m6 X; |        else inc A_i by 1# U/ }7 i6 s3 [. \
    end, |6 R9 C4 K# H- c/ [9 k
end
( z4 ]% X, n6 q6 j- V) [/ O
: X/ P; D) }: V# \& W4 F1 ybegin P_pick2 arriving
/ V2 o& m3 ]) Z7 |! f/ ?    set A_i to 11
* |; P9 z* o- A8 Y( q& X4 l! L$ e    move into Q_induct2! J* T- U' x- m) g9 A9 x7 a
    move into pickaisle.induct2
4 o; s* h) y) y    while A_i<=30 do begin) j) [+ q* K; {
        travel to pickaisle.con(A_i)- n- @! ]9 x# {  X* P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 Z# V( Z  L9 l4 K% [  [# z3 Z9 u        else wait for 10 sec
) B+ X) s  B9 ~3 ]% I        if A_i=A_leave then send to die
- G. B. i7 c  i& ?4 N6 k! j) j$ W        else inc A_i by 1% K2 ~) D& g, g0 J, Q( Q( T" \* V2 K/ F  ]
    end! Z( j8 O* c. N  v) G% N! o4 m
end
3 P. N5 r$ y& R& D( o
3 N& z+ E0 l! c2 Ebegin P_pick3 arriving
6 d, j1 P# p3 X    set A_i to 219 R9 z6 h/ U0 d+ Q+ L% l
    move into Q_induct3
* a& X$ Q7 X" z7 R3 e7 p) V    move into pickaisle.induct3' [4 x3 d0 F% X. S& J7 d( V0 V  r
    while A_i<=30 do begin
1 f- |1 _5 w/ c& |/ D* I! R        travel to pickaisle.con(A_i)( {4 P8 z9 f4 `9 f! T' A4 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p9 f/ n6 U0 P& D. L4 j        else wait for 10 sec
" ]9 T& _* {' C/ T0 G        if A_i=A_leave then send to die
2 a7 \9 N+ i: A9 G3 m        else inc A_i by 1
# ~! C0 W! K7 y% r& S    end; `  k3 ~2 g/ ~  |6 A: ]* g. k
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 y0 a2 J3 K/ _3 S$ D3 L6 Z9 Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 k  l+ L7 K) \: r5 ?

7 [* t! y, {+ G* F/ F1 ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: m* z- R  [8 J! J
0 N! i. c7 S( K, R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( `8 [# G/ V3 f" I2 `1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& `" U. t5 Z8 \4 p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 y; b- _9 w+ S# N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 i" T# W, }$ b6 E, B) C2 b
begin P_induction arriving
! h3 p) Y) K& [/ w; J. a    clone 1 load to P_pick(A_induct)+ B: N5 _" @+ x
end最大的系1 c! R9 e* R0 \" J0 O

$ H% h4 }8 s- ]( Xbegin P_pick arriving$ t8 v/ \" o5 L( h% I  ~$ Q* ~
    set A_i to procindex * 10 + 18 P& O, {* y2 |
    move into Q_induct(procindex), J: D2 b! z) a4 q5 M  X
    move into pickaisle.induct(procindex): u4 f# C# f/ N3 h; M
    /*check the type of pickaisle.induct(i), for your last problem.*/1 i. A+ ~  T3 }9 S6 G# K

; }2 T* l7 K+ N" j" D: @    while A_i<=30 do begin* f5 J; b3 a1 {$ K4 X5 E
        travel to pickaisle.con(A_i)
% f5 c! N6 m- ?* ]3 b3 `0 L5 L  c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 S7 C, D4 C$ [        else wait for 10 sec
7 T% w7 W6 Y! i& S" E+ B        if A_i=A_leave then send to die% |; Q; t- W( Y1 \# E8 r; U& i
        else inc A_i by 1
5 i; F8 N/ Z3 S* u( J    end
* D, s3 r! N4 {7 Cend
( n3 b  _- ?. t& U* N1 H% f# }6 z2 @; T9 q
其中的procindex为整形,代表当前process的序号。. h+ W- s) p; H/ O4 e3 ?( O; p$ Z
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-8 18:53 , Processed in 0.015889 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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