设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14055|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ b* a, M* G. H5 C$ m
& J5 l2 ]" U  l- e0 x+ m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ F4 _' g" T# f/ B8 y
+ p3 R' c. F! v% C4 k/ ]* y% C
begin P_read arriving+ u4 N$ Q! G- S* X5 @+ w; v8 y
    while 1=1 do begin' H4 |$ B) q$ q9 p2 G) c
        read A_tote from "data.txt" with delimiter "\n"5 |, o5 D5 v! u. D4 d1 h# n; z# Q3 V. p
        read A_time from "data.txt" with delimiter "\n"! s; G4 y& W; j$ R3 m
        read A_leave from "data.txt" with delimiter "\n"
; ]1 A5 f" N9 m6 y3 S        read A_picks from "data.txt" with delimiter "\n"
8 B% r5 f- ^2 W: K& l+ J. Y6 T        set load type to A_tote* U- k! F% C/ S7 {6 z
        if A_tote="tote 1" then set A_induct to 1. D+ ^  {" n/ s7 F
        else if A_tote="tote 2" then set A_induct to 2) E* Z$ J! |' x) k1 ]
            else set A_induct to 3    ! Q$ M, X. H! B+ c" @" i9 d
        set A_i to 0
+ {2 S- @' Q, t0 b" I6 k1 [; ?        clone 1 load to P_induction! z' t' R5 I# S& B- u
        wait for A_time sec
7 z- C& a7 d5 \6 K! w" g! ?: t4 x    end$ I; G6 A9 B* ~* K2 P; Y5 H6 t. Z1 }* J
end9 K0 K! r. ~# M+ X
; U7 E$ U; }  L; y  J9 K# C
begin P_induction arriving
" N, \4 f0 I6 I$ A0 i    if A_induct=1 then clone 1 load to P_pick1
+ u* {; k5 W3 l) [    else if A_induct=2 then clone 1 load to P_pick2
0 I% ]% f6 D; j        else clone 1 load to P_pick3
, a! F" [, O1 @, V/ I6 hend
! \- l) ~3 k- a$ X6 K* [/ y. g+ i& X. p0 o0 r% N
begin P_pick1 arriving$ n& L/ ^/ Q* ^# M, [6 w
    set A_i to 16 Q( T; [) Z/ X& v/ a
    move into Q_induct1
! L' v) `1 Q8 @$ k# A    move into pickaisle.induct1' q8 B% H4 L2 G3 f5 t+ |
    while A_i<=30 do begin- y( W# i* `6 E) [& ?+ {5 r
        travel to pickaisle.con(A_i)8 r6 ]; D, ~: u" j4 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! b8 F2 U; |% \, F( p) W
        else wait for 10 sec& u2 j) z: [+ d( S
        if A_i=A_leave then send to die2 f  E3 z1 l* F' F( F/ |3 k
        else inc A_i by 1
" e) F  P0 X( U  J; _9 z    end
9 t% l1 S5 b7 k! L$ Yend% k1 z8 r8 ^: n* U1 q0 k

0 G7 S$ d2 D+ w: }7 x  F4 ]begin P_pick2 arriving
2 w% U% `# `2 f$ ^! p* R- v" x9 j' D    set A_i to 11! {# T# D, E# v+ u# C6 O
    move into Q_induct2) R0 |9 I3 e8 Z" m9 E4 w: n" b# h
    move into pickaisle.induct2  C0 A8 I% q4 f8 N
    while A_i<=30 do begin; B% u' |' V: w7 O
        travel to pickaisle.con(A_i)/ {2 b0 u; R+ v; p; _0 [. Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- E& C( H  {5 I
        else wait for 10 sec1 P- f* G6 L  g+ k! r1 f* v
        if A_i=A_leave then send to die
. W8 {8 y' S' B. u2 q( A        else inc A_i by 1
: }3 G! ^, M+ c& R: w6 `+ i/ r    end6 ]* a9 S8 k3 x
end6 h" b. t& @  F) D5 u# a  y  e7 l
. g8 a: @1 _; L- I# ?+ C% o
begin P_pick3 arriving
$ _: _4 x) p# }5 \0 w    set A_i to 21; d+ a6 p" R3 Y
    move into Q_induct3
  ^( B0 ]0 F" ]6 I7 X' }    move into pickaisle.induct3# `& T* q1 Z+ ^, Q6 x* ?& _2 ]
    while A_i<=30 do begin
+ O; D, c  c" `* Z7 N- {- s        travel to pickaisle.con(A_i)
. P- Q- \/ `. q. k* S5 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% y+ v9 f) @0 Q* V3 D+ x# h        else wait for 10 sec' K- s0 \. N# S. e% w% h7 w
        if A_i=A_leave then send to die
, ^; R; \8 K; _5 v. ?: }' ^2 S- u: ?        else inc A_i by 1/ g: ?2 J! [3 T/ ]- q' d9 x# i% w
    end: p# o. U' N6 i
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是个什么东东?8 N$ ]; w5 w2 y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 W+ ^+ }9 }' B- Y  A; @0 [7 J- B% s9 _  `+ Y5 W. O4 S" [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 z" B3 Z; e7 F4 z

8 N1 s5 T% f: \0 p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 w' s" _  [, \* ]/ u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 q( ?2 U9 Y* s5 z4 u+ x: A* }2 j' K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% |7 J1 _1 c: d9 w7 C5 I* D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% ?$ X0 V/ V% q( x
begin P_induction arriving/ F" f* j% ^+ l! d5 {7 W
    clone 1 load to P_pick(A_induct)0 t! h6 P% k8 A+ `" ~( ^& m
end最大的系: ?& K$ n) |- y8 x

1 G+ _; _! S- k4 q$ _/ \begin P_pick arriving$ J, J( h8 C2 ~' L+ s2 S
    set A_i to procindex * 10 + 1
' Z6 @5 E4 w% S  U" i- j    move into Q_induct(procindex)4 q# m( T5 c3 [7 Y9 I5 L
    move into pickaisle.induct(procindex)
* C, l6 b: B! |9 ~% t; q    /*check the type of pickaisle.induct(i), for your last problem.*/
4 A" h5 z- N$ X: T( k
* V& S1 z% x  P# ?9 J* h    while A_i<=30 do begin" v. D$ @* [# s: `( |& O! H
        travel to pickaisle.con(A_i)
3 g4 y3 N( S0 R5 |# M* a8 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 F2 M9 Z2 t8 l; l        else wait for 10 sec
3 t: |* @, T7 L  z- ~7 p+ w: J        if A_i=A_leave then send to die
2 I: ?! J# m% c5 G0 b; |. x& ^        else inc A_i by 1; |9 ]% J, M6 J# c
    end. S/ @1 o9 D" t- F2 d
end6 O+ s, B& h: e- p

, M7 `. Q+ i) ^其中的procindex为整形,代表当前process的序号。
5 Q+ L( g! I+ J# L0 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-3 22:26 , Processed in 0.016455 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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