设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13918|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ z9 D: t% o6 \& b5 Q* X* ~8 m

) |; c5 a: t* N/ i我的问题是,在每个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; q& }& o) A

. P2 P# r, F; N# z, {8 Zbegin P_read arriving
8 M# F8 L) ?) O3 I; [    while 1=1 do begin
4 T* V$ }4 i6 D7 K8 m        read A_tote from "data.txt" with delimiter "\n"
& n/ s% L* @- r! K6 Q8 V% Y" J        read A_time from "data.txt" with delimiter "\n"
1 |6 w* B* ?/ p3 r! O; J        read A_leave from "data.txt" with delimiter "\n"" R# h# p( Z2 b* W# l5 }+ v& M
        read A_picks from "data.txt" with delimiter "\n") }4 ?# ^$ [; F$ W' _
        set load type to A_tote5 b+ J4 q, t% v" z6 _9 K, V; \
        if A_tote="tote 1" then set A_induct to 19 A5 ]1 I0 h$ d' p4 u
        else if A_tote="tote 2" then set A_induct to 2
; f; \( Z7 z$ W            else set A_induct to 3    * M+ {# c3 s5 @. F
        set A_i to 0
( E* g! Q* y) `2 |4 @5 q+ ], Q        clone 1 load to P_induction7 Z; J1 F% j9 Z& y2 B& L6 S
        wait for A_time sec
, ?2 I! L/ ^3 X$ U3 g/ i    end
1 n1 `, S4 O- {end
, u% e0 s& Q% a& Q3 m2 A0 a9 c) }- |' T1 ^% p( d2 B5 Y
begin P_induction arriving# n5 x3 {* Q- k9 z, I0 o
    if A_induct=1 then clone 1 load to P_pick1
; H* G6 ]7 K7 W0 \4 V    else if A_induct=2 then clone 1 load to P_pick2" w8 j" e0 ^8 X, q; S
        else clone 1 load to P_pick3
9 p+ C. _* c5 ~: Z' I' n) Tend
7 D, Y" D1 o! _1 E! L. P/ W
$ B2 r+ f. |: i3 Sbegin P_pick1 arriving
, d! t) f1 ]% b+ o  m+ _. B    set A_i to 1  g8 }1 b5 |. ]
    move into Q_induct1/ o3 c7 ^; r; A
    move into pickaisle.induct14 h4 o! b  H3 h
    while A_i<=30 do begin+ }' A' F4 Z* M5 @$ m( Y
        travel to pickaisle.con(A_i)0 p# d. d' |7 [2 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& \, @4 K4 F1 ?. L0 B
        else wait for 10 sec0 k4 R( ?& e$ Q9 W, ?! _) o
        if A_i=A_leave then send to die
% [: f0 I, R7 A        else inc A_i by 1
' g* E5 g9 L. |2 ?1 ~, |1 w    end
1 d8 y. C( @: |' lend
4 }8 [6 }3 _1 W& W# R: m: A# w- G3 h5 D  E( b: w5 V
begin P_pick2 arriving/ \% p# j0 E2 C. d
    set A_i to 11
3 J/ F8 c' D% i0 V. G( _    move into Q_induct20 s/ m% [6 p  c$ t2 }8 k! z8 f
    move into pickaisle.induct2
6 x+ Z% g% z$ n8 ?, `    while A_i<=30 do begin1 ?6 i/ h8 m$ m% F/ P
        travel to pickaisle.con(A_i)
( f) e0 q9 Z4 h( ~) ?9 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c, o; N4 V$ N
        else wait for 10 sec8 }3 E4 ~& j. t9 T
        if A_i=A_leave then send to die. `6 M  m& v: ~3 e: v* f1 s
        else inc A_i by 1
: H; h5 d* I5 I4 L    end
6 y) ?: @2 @+ E' Q7 g* }, O) [% g& [end
$ u. w) V; k1 ?) x/ R2 `0 w% Y# K
( z$ m4 B( {  @$ J# V% {begin P_pick3 arriving
" c% ?* E; S* E    set A_i to 21" h6 @  X" p) i3 p5 n& J
    move into Q_induct31 F8 I" K1 a/ a6 v; r
    move into pickaisle.induct3
0 V( T$ E- ^( q- T4 s    while A_i<=30 do begin# l) u# M4 H( X1 T- K' D
        travel to pickaisle.con(A_i)+ Z  P) d- E0 m& y( \+ y+ X% n' b! Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 c- p% N) Z5 y) I        else wait for 10 sec
0 S' u7 s; x* Z' V4 }        if A_i=A_leave then send to die
  O1 W% _  l' U; j% m        else inc A_i by 1
9 g' t' P8 _" r# O6 G    end% s8 ]- B+ Y8 c
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是个什么东东?& M$ G/ q! H- v; Z" Z1 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ k+ t3 |1 X9 e1 {( E
( S) z5 ~+ @. L1 IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! h% X3 j  j; ~7 ?) @5 K$ u* d' O' G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( F  E7 N: s2 f6 u7 W6 N; S7 h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 q: T% h* B5 X  _) O
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! L5 H& n/ Y" i+ ?# z9 P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; k, t1 i. }& {9 p7 D6 A; P, h
begin P_induction arriving# z  e7 v; V4 Y) N) v$ u: b
    clone 1 load to P_pick(A_induct)
% O2 a7 f4 A  G: ~+ |+ W) G/ Gend最大的系! \! ?# y( {& E, j

$ N2 h( H/ n2 g4 ^  A- Y3 S' t; N, Ybegin P_pick arriving
, _6 S9 K# h( }. x7 z! d    set A_i to procindex * 10 + 1! H" a, c0 Q' p- W4 C
    move into Q_induct(procindex)" q1 j. t$ q) ]! V7 ~* s
    move into pickaisle.induct(procindex): w# x( ]0 ?% L8 a5 z3 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/) x; @1 q; |' `& f( m  G, @  E

& J1 j& t7 m$ a* E: D$ B    while A_i<=30 do begin7 m' a6 Q9 U9 r1 l( [7 A9 o
        travel to pickaisle.con(A_i)# Z2 p" h* J2 l! M. K+ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 w7 z8 X! f4 U
        else wait for 10 sec0 o' t- o) \3 H4 U" f  Y9 Y8 c
        if A_i=A_leave then send to die6 O( k, e& Z) {; N0 Y
        else inc A_i by 1
, |8 D8 ?, N/ m; V) H3 R    end1 }, B$ }' s, B7 o! b: r! K
end
& }2 N" w8 `' d+ B# M+ _
% L9 [1 s, \# [其中的procindex为整形,代表当前process的序号。
1 r& v/ p, _+ I- tstation和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-5-19 02:13 , Processed in 0.020694 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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