设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15536|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  K# C' C8 a; |5 O2 f8 I$ M/ _
, V2 k# W2 U8 H- M" f  M! s& `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) Z1 `8 e. h' o$ z& o% L$ d2 e

# f  \3 g: Z8 X+ a; P5 Dbegin P_read arriving
& N6 ]0 w) a5 ?- {' {2 g( [    while 1=1 do begin
0 y, C9 e6 T  k6 c3 t! a6 p        read A_tote from "data.txt" with delimiter "\n"
3 ?' U( H! H2 ~/ _; g; Q4 Q        read A_time from "data.txt" with delimiter "\n"
/ \1 \5 R2 Y$ g4 i' Q: e4 @        read A_leave from "data.txt" with delimiter "\n"
: v9 N$ U& V: k        read A_picks from "data.txt" with delimiter "\n"' R4 i6 F' B5 C: U: ?( g
        set load type to A_tote
# w% o1 [- M' {4 U3 _% M# u' T        if A_tote="tote 1" then set A_induct to 1
' H6 l; F1 w0 V+ V        else if A_tote="tote 2" then set A_induct to 29 @7 D4 y2 [( v3 R$ T, \
            else set A_induct to 3    . F7 X8 J" z) L% t" y2 q
        set A_i to 0
4 F5 e; Y, p+ n        clone 1 load to P_induction2 K' O. _0 k8 k
        wait for A_time sec1 q% G8 c0 K% s) w- a
    end
2 B  }* E2 x: a0 j+ P* t- `end" y2 z$ e+ L1 x% D) P0 V4 H. J
1 y8 c9 N8 Q/ z- D( z" Q/ T$ o. [$ x7 |
begin P_induction arriving
3 Y: ~( X; u: Y# ~    if A_induct=1 then clone 1 load to P_pick1) l" X' V8 S+ e1 E0 p: k
    else if A_induct=2 then clone 1 load to P_pick2
7 }2 Y9 e' g( Q8 `        else clone 1 load to P_pick3
; P+ g( S% V& a( k/ s. i# ^# K% Dend: M3 T+ V. ~$ I6 ~$ L  D7 M  j2 [9 q1 h
; H. B' h- N/ {- Z! \+ I5 f, A
begin P_pick1 arriving; N  p) N0 Q$ D: z6 E) B
    set A_i to 1
; m9 v/ z: ?, y; a3 M    move into Q_induct1
  j2 `4 [. Q; K6 ]; f6 m! [$ s# z    move into pickaisle.induct1  R& ~) p* z# Q% H0 W3 L* ?! T6 k
    while A_i<=30 do begin  L9 P8 f& p, u3 _/ O+ C
        travel to pickaisle.con(A_i)) \: P+ x" ~' Z8 g1 j5 f9 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% r8 r0 J2 ^+ l% f0 }7 z
        else wait for 10 sec  X# ?0 p: o: W
        if A_i=A_leave then send to die
$ e+ B4 R' Y- U" g( B        else inc A_i by 1
5 n2 U4 X' U5 g- w5 x    end% c& f3 I: V' h) P) V
end8 z  K4 v1 Q4 h! I- G4 ?1 L9 t

2 w" i- q* u2 L  Ibegin P_pick2 arriving+ j9 R+ a+ w0 y* @/ _  s% f
    set A_i to 118 y' `' q) }  M
    move into Q_induct2
; A0 c9 @. A- h) T% v9 i% n+ k    move into pickaisle.induct2+ R& Y  I/ m. Z  g- X, ?
    while A_i<=30 do begin
9 P0 }2 e, ^% S( p1 j- ~6 H        travel to pickaisle.con(A_i)
& H6 f1 t8 ^, t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ t- Q6 k6 d( e) b: u
        else wait for 10 sec1 H& Z) j" u' n$ ?! P) J" x
        if A_i=A_leave then send to die8 M( b7 B' o' N5 A4 @
        else inc A_i by 1
1 R. u% k" R' q% V6 G    end
0 R+ a  W' i/ W/ S2 n$ ^end
! X* _& U+ F6 {9 a' E
$ i! \! P& A7 r4 V3 z. B. \begin P_pick3 arriving. G* Y- l5 {: p# x
    set A_i to 21* y; `% ~2 i7 U' d) V4 q, O
    move into Q_induct3* d0 e/ [- N! l8 N9 a
    move into pickaisle.induct3
- v, Y( n! M3 O2 k8 t    while A_i<=30 do begin
5 C3 b5 R. g9 P& ?' m& T        travel to pickaisle.con(A_i)5 G/ N, ?: j( D4 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ s- d4 U, x1 [        else wait for 10 sec! E! p6 ?4 t; V8 s, ^
        if A_i=A_leave then send to die
" f3 I: \- b) Z, u9 N        else inc A_i by 1# M. V: G$ f! R4 O, U" a7 v* E
    end2 V2 d/ I! M9 U# N  g
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是个什么东东?
( A* r8 \  a1 `1 L& p7 fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 P: _1 h# `# y% k- o) z

- ~4 A% D. D. D, u4 yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 |& {% }' L! P$ C4 s$ Z0 u* r

$ h/ z& P; V- Q9 U: Q; V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 K" ~3 o$ Z: b  Q4 P8 w6 l8 i2 Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  ~3 r0 s; ]$ O5 m7 ?8 m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) v- U  _% B  t
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 v3 o3 a# z3 m& ?
begin P_induction arriving
9 x0 p9 J& J: Y$ ?    clone 1 load to P_pick(A_induct)! f  q0 |. e1 _* Q4 ~# \: o& v( r: k! q
end最大的系
' ^) o6 U. c  G. D; \
, n: m$ s. Y6 ]* C6 a2 Pbegin P_pick arriving
1 F. V, B5 A7 S8 v6 d  A    set A_i to procindex * 10 + 14 N7 q6 b. F; O0 _
    move into Q_induct(procindex)
3 P( f! Z9 L# B    move into pickaisle.induct(procindex); L9 i7 H$ L7 ?6 U) a5 G7 W+ w* I5 I" s
    /*check the type of pickaisle.induct(i), for your last problem.*/
4 k9 i1 M7 r6 [( |  \5 Y# a0 ~# A+ R. F1 W5 l3 Y: O
    while A_i<=30 do begin, c5 W  @/ r8 q4 I
        travel to pickaisle.con(A_i)! I! E6 J, |: }& V8 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  b: s" L, A# q8 v! K! \        else wait for 10 sec# x  L1 t, K6 L) r+ \1 K, U
        if A_i=A_leave then send to die
, c4 ~) ?2 G/ j- h! ]        else inc A_i by 1
; d& ^) r/ n9 j    end
% f1 }' h7 r% V* a5 rend6 U, e; Z9 {, j% J5 E7 b! P
' C' L' s8 I5 @! \8 c- v
其中的procindex为整形,代表当前process的序号。+ f0 _. z; o8 D! p5 `& [4 K2 K
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-9-18 23:15 , Processed in 0.015033 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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