设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14116|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% r$ `' W6 a3 p  K. z" w- K6 V( n! @' \& v( d5 Z3 V7 v; c3 e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ x" e) U7 y; [1 G$ B  Y2 z5 P# w
% v6 ?9 Y$ f7 Z' ?" x7 j& k2 pbegin P_read arriving" f. K# _; J7 h( j5 u" y, ?7 m
    while 1=1 do begin+ F4 j2 N4 X. Q- r6 W  f
        read A_tote from "data.txt" with delimiter "\n"- G& n$ e! P5 b- ^) o# A
        read A_time from "data.txt" with delimiter "\n"- G, i/ R9 N# i. H
        read A_leave from "data.txt" with delimiter "\n"
6 d+ D3 V9 C/ I+ M        read A_picks from "data.txt" with delimiter "\n"+ |$ t' W: t& a* J( a+ n
        set load type to A_tote
% Y# @: v: d. c2 s5 o% [        if A_tote="tote 1" then set A_induct to 1  d% W) K! b; W/ e5 G" ^
        else if A_tote="tote 2" then set A_induct to 2
  u1 Z7 J" f& E6 O0 b            else set A_induct to 3   
0 x2 p7 f5 e- w0 {4 N0 _' h' S* u        set A_i to 0
7 k3 i% J0 \, s: I: _        clone 1 load to P_induction8 D7 d5 q" T7 R9 v
        wait for A_time sec0 j3 A) p5 E7 z, |8 ?
    end
0 o7 ]7 N: [% z& B( p: jend7 H6 R: T0 s! ~' s

! a" Q# N% L4 Y! c% jbegin P_induction arriving
9 X# e7 q1 X8 c4 c/ R# O3 K: D- X# c    if A_induct=1 then clone 1 load to P_pick1
$ Z4 Z. ?4 h; m! _6 V" p1 [    else if A_induct=2 then clone 1 load to P_pick2
0 ?. W* H2 I) C9 }% j/ G        else clone 1 load to P_pick3+ j6 Z/ p! c+ j! [8 y( K$ R* @
end
3 q  M0 b4 b% K
2 I  X8 y, U2 j" m: c1 Hbegin P_pick1 arriving0 x$ R5 n/ ]! _, p& y. e2 l$ P
    set A_i to 1# S, T% |& x; H, c: ~# C
    move into Q_induct1' M; u  I1 K) j+ `0 i0 @, Y
    move into pickaisle.induct1
! X# W% T+ q  R6 X    while A_i<=30 do begin
- O. n& h7 |* W( Y* q5 x        travel to pickaisle.con(A_i)- @5 z' b1 M9 c4 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, v2 g0 a" U" I2 b* {' s
        else wait for 10 sec
$ ^/ q0 Q" d2 X" S0 L3 r# V/ }/ g        if A_i=A_leave then send to die
( Z0 N! z0 m# @, R        else inc A_i by 1
% U( l1 Z- S: _! ?    end
2 D2 G$ A1 f; n+ F; M- f6 _end7 L2 m& O7 [+ a! T

& x7 ?/ f( n. k; cbegin P_pick2 arriving/ H" x* b2 S* b3 q( J+ J5 Q. ?) C8 E- c
    set A_i to 11
0 S" ~" z+ S0 N5 m( r# P    move into Q_induct2
" h$ ?. e1 U8 p3 T5 n    move into pickaisle.induct2
! L" t- J- ~) N4 I9 t) ^. m    while A_i<=30 do begin
& K) q3 R1 U& \4 N* m6 I" N+ R        travel to pickaisle.con(A_i)& m" t1 O1 T8 h; b3 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 u& d- S! E+ W
        else wait for 10 sec
+ z% I/ z! u' }, C/ o9 s        if A_i=A_leave then send to die! j+ v  ?  ]# r3 r) ^
        else inc A_i by 1
/ v+ G1 t4 {( T' j- v  S    end9 ?* R9 x. y0 z& {! i
end
- V1 x6 a5 t% Z! q: P9 Z1 ]
$ y- @0 k* K6 J7 d3 x3 Ybegin P_pick3 arriving/ x/ d% y2 {5 Q" C% `% s
    set A_i to 21
5 z! U0 s3 M3 [8 }. W' b    move into Q_induct3
0 L* a9 o' r4 A" S. n    move into pickaisle.induct3
7 f- k0 n/ V. [' U    while A_i<=30 do begin
5 q: c$ d& g3 o- E        travel to pickaisle.con(A_i). Y3 J4 M6 G' v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 J: T% R2 Y2 M8 C+ |0 m3 l" j' }
        else wait for 10 sec
/ G" z# b: w' T/ c3 r; L# N/ G8 a: T. K        if A_i=A_leave then send to die
/ ?3 O9 o- K) D( E( n4 o* L# @        else inc A_i by 1) L, w2 S+ t7 e
    end
3 n8 F& J1 H( ]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是个什么东东?- r9 l/ R- q5 A: s  ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 }' I, X( [( J( P/ c! G. T& G
/ q  G/ ?- ~4 Y6 h& x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, |8 i, E; j' X+ R0 B6 A
7 M* o1 i' @) v9 h6 n' J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* l+ b& m8 C1 _& Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 b( q' z% ]: M) i2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 j: z- ?' |4 ~$ h
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 K* m' c, F$ O. x- S
begin P_induction arriving8 d8 Y4 X. G' n. w
    clone 1 load to P_pick(A_induct)
" }) b( R- H* H1 W# B" S6 b5 Xend最大的系7 ?' U& I) g) D- F- }  ?3 ~
* X! s7 U3 c. E. U1 p# R9 F
begin P_pick arriving# k; G6 j- k+ O! q+ j
    set A_i to procindex * 10 + 1& I8 g' K5 n# f" K8 h2 g0 u! n( Q
    move into Q_induct(procindex)
% h, S( {5 [+ _+ \    move into pickaisle.induct(procindex)* e" D& a3 V1 O6 k
    /*check the type of pickaisle.induct(i), for your last problem.*/; g8 ^0 ~% U9 `3 k# d
8 O: O7 z! t, o) A8 U, R" p% y6 O
    while A_i<=30 do begin( l9 \9 t, B8 w9 W  v( E: O7 m: n
        travel to pickaisle.con(A_i)3 p; b' o( u5 ]5 _% Q, c' A) g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ X* ^: Y& b& B4 v0 P0 D        else wait for 10 sec
# q: `! u1 y! f* a  l        if A_i=A_leave then send to die
2 w( ^' e  D( u        else inc A_i by 10 m0 g/ {/ y! k% r6 o. X
    end% N4 I+ R/ _/ n/ \; u5 w3 e" V
end
/ v, b& B1 b" o# ~7 V  s3 Q, F, d5 K& t. k" f: G: E4 Y! ]
其中的procindex为整形,代表当前process的序号。
& s# w% \+ H6 x# Bstation和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-10 11:53 , Processed in 0.016790 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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