设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12401|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, B% q( i* i1 {) I+ _* k+ v/ r
/ o+ f- \% X& i( X  ]6 j我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ A; Z; b3 q- U, o# }- l2 {

, O: _3 F9 B: Y1 I; D1 rbegin P_read arriving+ Q/ E6 t* ]' q; m+ E( B
    while 1=1 do begin
7 x& S) z: _' P' @        read A_tote from "data.txt" with delimiter "\n"+ B! j, X5 x4 D' B
        read A_time from "data.txt" with delimiter "\n"( \$ k  k6 Y" ]& r- p' V- x3 Q
        read A_leave from "data.txt" with delimiter "\n"& Z( w2 c5 [0 Q1 }- ?" S* e1 T
        read A_picks from "data.txt" with delimiter "\n") g6 m7 U% T: E  m9 O
        set load type to A_tote
7 q: U/ i( Z6 |        if A_tote="tote 1" then set A_induct to 1
& T. a, M# E4 T6 L' A5 Q        else if A_tote="tote 2" then set A_induct to 2
# G. ~2 S4 X4 v% t* \            else set A_induct to 3    % J2 J% p' g$ M  `
        set A_i to 0' s9 |' v* E; ^: }9 R4 s' x/ \3 r
        clone 1 load to P_induction7 s, d8 A9 R) u
        wait for A_time sec/ s3 I* w/ Z, K9 o4 a& u, E
    end
& I0 A& q& B. D* u1 n4 A! r! ~end
- J/ j7 l8 V0 ]- h* N" N9 j7 |( i4 Y2 c" z5 A! b8 h9 v
begin P_induction arriving
. E' j7 D2 f  g    if A_induct=1 then clone 1 load to P_pick1
8 c. \2 x; @7 V    else if A_induct=2 then clone 1 load to P_pick2/ s( h' W, D9 g( H# W9 W# a
        else clone 1 load to P_pick30 w4 o0 V: m5 C4 d1 _8 {5 \
end
$ ?. |  R% E3 z& f; K
8 ?2 n+ K1 V1 c1 G9 R3 Z2 cbegin P_pick1 arriving
7 W0 J5 G( n7 }) T/ {/ q    set A_i to 1" u8 z: d  J7 \& O* M
    move into Q_induct1
$ D( `( m4 Q: k$ A: q3 M    move into pickaisle.induct1
5 b7 n. r; _4 [9 U    while A_i<=30 do begin+ M0 Y( o: j8 e* k( d, P7 I/ e
        travel to pickaisle.con(A_i)3 a. g. U% T8 h/ Q2 Y+ D1 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" q% a7 E% `' D' d2 X        else wait for 10 sec
- U0 i# T: V: R  R: z; h1 U  S+ e        if A_i=A_leave then send to die
1 N- A4 ]1 K& R0 ]2 n$ h0 x        else inc A_i by 1# \5 L/ h4 Y/ V6 V# L1 p& O) _
    end
0 E6 X$ _; F& E5 R8 yend
6 `$ _, x6 ?: Q4 {# |/ z, E! b' K. f/ b) o. ?: _
begin P_pick2 arriving' b8 q( p+ D2 e' W5 N
    set A_i to 11
. U; @, j" ^; B2 [/ ?  g) V" d8 D    move into Q_induct2
0 g! z( O# E- j; K. V    move into pickaisle.induct2/ w( v/ A6 I5 ^/ L9 L; `" |
    while A_i<=30 do begin
( B( _8 e; D. D  N2 a        travel to pickaisle.con(A_i): l: T; \/ r! l( Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Q9 C6 E% B5 p6 o( K: |
        else wait for 10 sec; k: M6 j4 L* ~/ K
        if A_i=A_leave then send to die/ D* K, _6 M5 T9 i
        else inc A_i by 1
: U$ @: O4 s; T. K2 l) v    end
% q; ~7 I& p, X& A8 K) Gend4 t& d$ F- Q8 l+ V9 P2 j

$ q5 T4 ?! g- R3 l0 a* a! rbegin P_pick3 arriving) M6 O( |% J4 M* F* R1 L9 l7 K& m
    set A_i to 21- W- Y" E1 r% F- }# q- ]
    move into Q_induct3$ {0 R; s0 c! G' b) H4 }6 m% `
    move into pickaisle.induct3
% c$ U* D9 O' u' {: O, s# W    while A_i<=30 do begin) l8 o% F" ~  |2 h: q
        travel to pickaisle.con(A_i)1 G1 A9 V: |  H* r. ?; [0 w* O; e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 M' _; `  ~3 i/ A% K        else wait for 10 sec) m: x- G  B* A$ ]# J
        if A_i=A_leave then send to die
- @$ N5 j9 }! W9 K3 `9 L        else inc A_i by 1
; s& R8 ?5 G% i( c/ b1 c9 d    end
4 L; u0 B* E) m8 Q. b. E% zend

最佳答案

查看完整内容

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是个什么东东?. t  a5 `1 @( Y9 f* V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  _7 a, y3 J4 R
  W5 C0 s! p# Q8 P6 J/ S
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; Z0 e8 @' ]2 ~1 I- l: a7 C
) k$ ~6 K! ^7 R, D& x/ P& C! }' Y% ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 X7 q. Z( s0 c0 R. R. h' @7 O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 @; L1 _9 y& b& F# S  l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ c! ?7 n3 i7 l) X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. L7 T3 s. _0 T& [2 `
begin P_induction arriving: E- V  \* U' _9 ~
    clone 1 load to P_pick(A_induct)
$ O; r' O; S( h4 R2 N0 h; i/ }% tend最大的系
4 n/ z- N2 k3 I/ d4 n
' [. d! [0 p4 j( b  L( I! ~begin P_pick arriving* S: H1 |9 ~% G2 I0 h: _( `. Z
    set A_i to procindex * 10 + 1$ F* L$ ^6 _$ F0 L+ p# `
    move into Q_induct(procindex)8 H: v3 l* a  K2 c+ D
    move into pickaisle.induct(procindex)
" h8 a, U8 }9 y; Q    /*check the type of pickaisle.induct(i), for your last problem.*/
. b3 h/ C+ {- B" J  W
( m5 {! m, P! u    while A_i<=30 do begin3 l" S2 d3 W/ t+ _
        travel to pickaisle.con(A_i)( _( a" J0 x! r, |1 `9 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ]+ J/ N% O; Y" m+ q/ k! J' B5 y: j        else wait for 10 sec* n9 [0 f/ `8 e+ l/ x  R- d5 o
        if A_i=A_leave then send to die
+ \: A) {5 V5 R: g$ w) G        else inc A_i by 1
+ m$ I0 h2 H$ j. X& m% L    end0 x# v" T5 [  k$ E' \3 O8 ^
end$ s9 W' C2 B3 B3 H; e  L* `8 p
" m' C. g* a3 g
其中的procindex为整形,代表当前process的序号。
4 S* l* E6 ^8 r5 ustation和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-1-20 21:02 , Processed in 0.017067 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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