设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14637|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; f& U+ T$ A- m, C' C

" @8 f1 d) {6 F4 C我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, _' \3 W! M- ~0 F) i- E2 G$ w: Q
begin P_read arriving0 z: v8 ^' T0 z# C2 H
    while 1=1 do begin* n# X: B# Q$ A, ]( T
        read A_tote from "data.txt" with delimiter "\n"
- [4 `: F' K, l% y7 @9 P0 [        read A_time from "data.txt" with delimiter "\n"
1 q: l& Q. D' I; C" {) t        read A_leave from "data.txt" with delimiter "\n"
# q5 E5 b7 y  }! D. v0 G        read A_picks from "data.txt" with delimiter "\n"
3 Z8 U, x9 x' Q- f1 c* {& w! `        set load type to A_tote8 g! Q% c3 D9 }5 ?% d
        if A_tote="tote 1" then set A_induct to 1- k2 ^# s3 L! s0 _% |
        else if A_tote="tote 2" then set A_induct to 2
1 G0 B) L; M  U            else set A_induct to 3   
. Q( @" p% |1 N4 N) Y! J& s        set A_i to 0- L) @8 ]- b8 a/ J# n
        clone 1 load to P_induction
: {- `+ ^3 V' p        wait for A_time sec2 F( E" Q1 p4 e* w
    end
6 d) }# h! }" cend. ]6 y1 y4 U( {. `  z/ L
  Y$ d! L* `* ?! z7 j' w/ @4 S3 p
begin P_induction arriving
/ f* @$ d/ v, K- O" ?  O) m$ K. {1 [3 z    if A_induct=1 then clone 1 load to P_pick14 N( V( r) p# b5 |8 M8 n
    else if A_induct=2 then clone 1 load to P_pick2. v% Y' U, A) H) U1 |
        else clone 1 load to P_pick3
- [% P5 B) _9 {8 Z4 W1 B( {& y; \* ?end# E# Z9 ^) {# P" B  l- h3 ?$ `, c7 x

& \* J4 W$ E( s/ X6 }7 Pbegin P_pick1 arriving! w* N) Y! Z: N* _% j
    set A_i to 1
# m: |( q. N" F$ P6 e1 H    move into Q_induct19 e+ @6 O4 C2 a9 L$ C
    move into pickaisle.induct1: Q) }' r! @: I
    while A_i<=30 do begin' {1 w8 a7 @# u. |2 Z6 y$ a/ v- @
        travel to pickaisle.con(A_i)6 }0 U  _8 a/ C2 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^& Q, k/ v$ w: f. G$ D) p        else wait for 10 sec3 p* R- N: A! [4 _
        if A_i=A_leave then send to die
' P) s9 d+ _8 @) X/ x        else inc A_i by 1+ c7 l  n1 u6 l; V+ V1 L
    end
' c/ l' a5 m0 r% O5 g- @end
7 ^6 E: c7 O) i+ c. t7 J+ e' ~* ]% a3 z
begin P_pick2 arriving- g0 x$ g4 N. S% X1 c
    set A_i to 11
& R+ C" L+ F" I    move into Q_induct2/ @6 \7 ?8 [9 Y# N
    move into pickaisle.induct2
" ?: I4 g7 ~' r1 w, E& y    while A_i<=30 do begin
* T  C' P& Q" Y% b        travel to pickaisle.con(A_i)
- @5 |/ I; ~! x0 ~$ z4 t) |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 H5 J: C7 W0 O0 ?
        else wait for 10 sec: M# p% E, L5 s% a/ w8 q
        if A_i=A_leave then send to die
$ M% b+ H0 l+ G2 F        else inc A_i by 1
3 v& y4 n1 K0 [9 K& r' L    end; t* D9 ~( b9 n; }) G7 K
end
  T: u6 d2 l3 u) \/ j" z4 h/ d
' K+ F% F/ O% p- [+ x6 t5 v& ibegin P_pick3 arriving
& D8 F& ~( a) r! j/ M    set A_i to 21/ q* D9 a9 x. u" x" l# g* w* w
    move into Q_induct3/ _+ o5 b9 V9 U/ Z7 g* ~) L' T
    move into pickaisle.induct3' C$ O! h* A+ Y2 Y1 C4 I& ?0 q( h4 [
    while A_i<=30 do begin
/ b& Q' L* X3 O, k        travel to pickaisle.con(A_i)
0 B( w- ~# Q; s* }) b% S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, v, c" @; O# s! b1 A8 [
        else wait for 10 sec9 C. ?' S1 _. ~) S
        if A_i=A_leave then send to die, i3 w! e$ X0 j9 ?; I3 J( D- u
        else inc A_i by 18 k& }  T" N! o+ ~# t
    end
$ W* g- ^; Q. T: k9 Z) Hend

最佳答案

查看完整内容

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是个什么东东?; d* B2 o! d5 s8 z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: n# ^3 `) b9 V% u+ o
% a  L: _  x% ]6 p* A' e: b+ I' ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, ~) R: m' _* y' V. Q& M0 |' |' g; a6 }9 Q6 z- T* c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 p8 R7 H/ o. `7 Q9 G- [4 e  L! {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ w# s# m* C+ t5 s! |6 L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" y5 H; Q( e3 \: d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 y* L+ r, p, Qbegin P_induction arriving6 C; P; l  M( ]' \. \  S6 e8 i
    clone 1 load to P_pick(A_induct)6 ^* c) F9 L7 c; v5 N; N8 A1 a
end最大的系. ?) L& Q8 Y( C) \2 K& r5 \& }
& R5 J3 v) o! o' D
begin P_pick arriving
; _1 [2 P7 |$ V2 d. k; N2 |    set A_i to procindex * 10 + 1+ V2 J+ j- D" n- G& u* r% s/ B& ^
    move into Q_induct(procindex)
4 [$ T. J# y% U/ g0 C( Y; ]) j! K    move into pickaisle.induct(procindex), K+ v  w% l5 A. {
    /*check the type of pickaisle.induct(i), for your last problem.*/
. i5 d1 V( }  B: s9 ^5 ~/ N2 B, b. k7 L# R1 e" p* o6 k
    while A_i<=30 do begin9 P3 d% m0 s8 p( @4 c2 r2 m5 O2 R( a% z
        travel to pickaisle.con(A_i), m$ J, S/ r; X$ e# {0 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# F2 I- N* ]* b  ]        else wait for 10 sec/ F6 `; O* ?4 L& K' v; P* }  V
        if A_i=A_leave then send to die
4 o' b! M( ~0 ]  k9 W+ {. Q        else inc A_i by 1
& r2 u% j# w9 h    end, t  g( n" t5 A* S+ [
end
7 n* ^% A; n, H; U5 T- Z9 ?  p2 i9 C3 F) s) \2 n' [
其中的procindex为整形,代表当前process的序号。' [( G# T+ t. S/ j" w5 h3 p3 y
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-7-19 14:13 , Processed in 0.014937 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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