设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11787|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' J/ c) I& B$ h2 }1 C' W! P
: z% X" r& c  j, T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" w, G& V! o  G, ], d# d" h; ?3 y5 v. k1 s- z/ L) E" H4 b' U
begin P_read arriving
/ s! c& j% c8 K) J    while 1=1 do begin) I, A1 h) E4 }6 V  y
        read A_tote from "data.txt" with delimiter "\n"
1 e/ f! E! b# c5 J. O  q        read A_time from "data.txt" with delimiter "\n"
8 z. K- a0 h1 q, L        read A_leave from "data.txt" with delimiter "\n"2 M' Y$ H0 w7 l0 M
        read A_picks from "data.txt" with delimiter "\n"
- n- F: _, U' Z5 B        set load type to A_tote7 g0 e' ~! T) g2 Y9 l+ S( \
        if A_tote="tote 1" then set A_induct to 15 [0 Z% f4 z" R" |
        else if A_tote="tote 2" then set A_induct to 2
; m' D: |/ Q8 J/ z  f8 d            else set A_induct to 3    5 b; K; o% y" H. n+ _# b. i
        set A_i to 0
' h( B, G3 e2 |* i7 o. n* m        clone 1 load to P_induction3 v# `- Z9 ?- R8 ~; b: S7 G* b4 t
        wait for A_time sec
( Z. u/ e) w" r- o9 P( A    end
" ~& t" v8 h& F/ y2 kend' P0 X: K. E0 }1 g% u( f

9 X9 n3 P. R, |+ Z3 Pbegin P_induction arriving
( O. h4 l2 h1 l0 L# J    if A_induct=1 then clone 1 load to P_pick1
1 e! O' f, P- k! L    else if A_induct=2 then clone 1 load to P_pick2
" ]! I: L3 t8 v; A/ w% h        else clone 1 load to P_pick39 [& t3 T! [# [% C
end7 E( d8 b- r. ^) S# V
; }" L. k3 x% S4 E3 N* f$ c
begin P_pick1 arriving" E( k$ P0 O$ R  P/ `9 f& _
    set A_i to 15 o0 g7 r" \3 x" v# N
    move into Q_induct1
' V7 I7 P6 f6 a" o' `" I    move into pickaisle.induct13 \& z* p+ ]* J1 u5 G$ F3 m3 e+ s
    while A_i<=30 do begin- |5 V3 k) G1 z8 h5 W+ O
        travel to pickaisle.con(A_i)
# r! c: o! o9 U, H3 x- f+ T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 f' w- P% y3 ?0 }5 x/ L
        else wait for 10 sec
! v7 \! J! o  \. a0 h- `        if A_i=A_leave then send to die8 V9 X+ ~' x" ]0 I! M
        else inc A_i by 1
3 d+ e0 q! W( e) Y# s, X! b5 Y    end
1 b+ D  d. E8 {! @2 A5 U  w# Fend
# J6 V+ M  c0 ?8 t1 m5 x6 J3 C  |6 r. l
begin P_pick2 arriving
+ k, b4 h0 q% I% i* l( j    set A_i to 112 z: Q) P6 z' p7 w2 u/ }7 j9 L; c
    move into Q_induct25 {/ g" g4 W6 F; R" y5 C/ w/ ?, E
    move into pickaisle.induct2
: h" i/ Q) U2 N6 b* Y! x  y5 G    while A_i<=30 do begin
4 e1 p3 A7 }4 F3 A        travel to pickaisle.con(A_i)
; |2 w/ i9 ^  t' C4 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 k7 b) o5 C6 Z! ?8 f! ~6 p
        else wait for 10 sec4 b# q- E8 j7 h/ Z& {# V
        if A_i=A_leave then send to die+ l3 v% W2 c1 N5 H# u. z
        else inc A_i by 1
. `$ r; v0 `5 ]- i    end, Z5 z3 T; N" }  }% e& d$ g
end* k9 u- [" }% t1 ]7 {4 g4 X
  u, F4 J2 D; A0 ]  O, l/ K
begin P_pick3 arriving
% t9 s! G. ~$ C8 L# L    set A_i to 211 M2 }# i- W/ K# x8 x
    move into Q_induct3
6 w, Z$ R% I7 N    move into pickaisle.induct3
2 |! S7 _8 e( h. V0 o    while A_i<=30 do begin" U+ m$ ~) k" v1 y  M. k
        travel to pickaisle.con(A_i)/ q8 `7 R0 J& o3 z4 Y- \7 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" X, s+ g7 m  q, @3 \! A8 M4 B/ [
        else wait for 10 sec  [9 O1 x8 o% w" `
        if A_i=A_leave then send to die! d0 N8 V! h$ ]% i
        else inc A_i by 1
. n/ [0 J1 t6 f- b. F- K    end5 O9 R' a# X: F+ e8 ]* X
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是个什么东东?
3 U. N, w/ f  lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% L: W& a7 o5 m/ S) B1 x7 P; q3 e- n1 {9 |" I1 @* ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ q! x: G: J9 X+ q" L  v3 o& ^- U% J
, @; e: t; k: u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% Y1 V. Y" d3 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# u% k$ I) o9 L5 w6 W9 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# ]5 @0 F; K: j1 W) o1 ~, A+ a0 Y& {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 Q3 R: G0 o2 n. ]
begin P_induction arriving
8 v# j& f2 s9 }4 T  D) o5 u, \    clone 1 load to P_pick(A_induct)
6 C0 o" n# r# r$ k# nend最大的系
; ^( ?( P) o) C! X: V; y( c& [; m! F5 X" y1 Y! Z. b. B; e6 Y) B! s
begin P_pick arriving
8 b" ~1 \+ @1 t# D    set A_i to procindex * 10 + 1
  z" ]) H. O: _9 }    move into Q_induct(procindex)5 O6 ?+ q2 l- @, a
    move into pickaisle.induct(procindex)
- ~* y- [5 W' G    /*check the type of pickaisle.induct(i), for your last problem.*/
( _3 X- M9 b1 s. q; _
( Z. G9 J1 f7 ?3 P* j7 G3 V    while A_i<=30 do begin
& q7 V* w) H2 {2 t/ ?- w& D        travel to pickaisle.con(A_i), I3 _% p5 _1 I: q) ]: J$ S6 P' m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 C+ \; Z$ V/ H2 z' M$ P0 g        else wait for 10 sec* ]! z5 w# W( s) ], c  C
        if A_i=A_leave then send to die
: H7 W4 m/ N5 ^6 p( j5 z        else inc A_i by 1/ H* E' Z: D. L) u6 T
    end2 y* A% W2 ?- d3 c( v, Y0 z
end7 `3 k, {( p1 {0 {

! G' p0 C' n' e: p2 K其中的procindex为整形,代表当前process的序号。4 [: q2 g3 g2 G# N/ T4 J7 g
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, 2025-12-5 10:19 , Processed in 0.023438 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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