设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15046|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; I# m3 p# z9 [8 i8 P3 G
8 m  P  A7 N" f: U5 I7 U, p% 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中的数值,不知道会不会有什么不妥。+ \+ h( M- E$ {# l! y1 d) U( _

' \: ?3 U8 n9 p' E  gbegin P_read arriving
0 X: B* x+ h9 C6 }    while 1=1 do begin2 M7 }# l* b, E4 j! x: P2 I
        read A_tote from "data.txt" with delimiter "\n"
  s: I' @- K' t- l1 r        read A_time from "data.txt" with delimiter "\n"1 R  @- M' Z* `# r. L/ @+ J
        read A_leave from "data.txt" with delimiter "\n"; x, D8 u# [  M. O
        read A_picks from "data.txt" with delimiter "\n"7 I- v' |- s6 k3 p! Z0 w
        set load type to A_tote' a, h1 B7 g5 E" \9 y
        if A_tote="tote 1" then set A_induct to 1  v. B4 e* ^% ]$ x
        else if A_tote="tote 2" then set A_induct to 2) z" @$ u# l0 b3 [$ G# P
            else set A_induct to 3    6 |  p& c8 d' w; Q* `# d
        set A_i to 0
4 @" r+ M* c+ y6 |% {1 ?$ Q        clone 1 load to P_induction, Q, u/ J) \, B
        wait for A_time sec
' u+ y0 f9 E6 ~1 {4 p* _1 V    end6 r0 O( `1 D( F! g1 q! v( q/ |
end0 |, E4 n% |* B
/ W$ t8 w5 x% D9 p
begin P_induction arriving
/ \- y5 E- \* w2 z3 e  B5 O* V( j    if A_induct=1 then clone 1 load to P_pick1
( e& X3 f3 e: G# W' Z    else if A_induct=2 then clone 1 load to P_pick2
2 x7 m7 X) b6 P$ `. A% X  G- N9 G        else clone 1 load to P_pick3& j; ^! ?5 F) S9 ^( A7 }! t
end
( ]; h9 w" P3 x; n; L" x1 l: k, `
" Q: c' q$ I! i; ?# O" e* }) \+ l- cbegin P_pick1 arriving1 U' k/ Y8 e$ h; O3 u
    set A_i to 1
1 t5 H1 Q+ a+ x    move into Q_induct19 N4 F+ I7 e3 g0 a7 P- f2 [+ p7 D
    move into pickaisle.induct1& N7 L, E3 C# v) P. a2 C
    while A_i<=30 do begin! T$ p, p) _2 Y' S
        travel to pickaisle.con(A_i)
$ }0 |4 I0 ]/ \; H( X3 z  p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T, ?8 X5 }1 |/ Y0 j        else wait for 10 sec7 x1 i: a, Z; z, G9 t* M4 [
        if A_i=A_leave then send to die
; s, h6 A: F) v- t        else inc A_i by 1
7 D" Q+ \: P) ~! N6 V; R    end: g/ a6 H+ G) s0 {
end  T' z4 }9 P  K. d5 |6 X- X% u
& K( ?5 [/ p' O9 b
begin P_pick2 arriving
# O. X9 \! s& P! S4 M( \    set A_i to 11
; [* S* L& C# |    move into Q_induct2/ j* G( n7 W& l1 K; S; H
    move into pickaisle.induct2: @9 [* A" V3 Z3 z0 F& p. H
    while A_i<=30 do begin" v: M1 `- ~7 J6 S
        travel to pickaisle.con(A_i)
. ?3 A; |5 E- Q( Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- [5 T) Q& ?& P) q# j
        else wait for 10 sec
2 h6 I9 H) @6 t3 G* A3 t6 t4 y9 l        if A_i=A_leave then send to die
4 g3 t$ u2 E  w& G! [5 D        else inc A_i by 1
; H/ D( q& [% b2 }    end* e3 j3 z* A& M
end
+ Y2 \3 R5 G% M8 w, {3 o
! |7 [3 s9 s: Cbegin P_pick3 arriving( i7 M  ]9 G) x2 L% Q. \6 |% c( ^
    set A_i to 21
9 s4 t. d+ T5 E3 O    move into Q_induct3
. n# C; w  o' G    move into pickaisle.induct3
0 A5 B* ?+ N) p3 P* L5 I5 e    while A_i<=30 do begin
- C9 z( O9 l9 t& L4 d! g5 w        travel to pickaisle.con(A_i)
: Z0 i* h1 s2 K8 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) p, x: Q' [4 @        else wait for 10 sec
7 V7 a# h' q$ \* {1 U* z/ n) e2 `        if A_i=A_leave then send to die
5 }2 N, U, g* {$ f0 p) F. H: V( e        else inc A_i by 1& z6 q6 ^% w# X$ Y
    end: W/ ^. r  z# |
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是个什么东东?( s8 {7 e9 j1 P" @) m. V) h; N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ M$ A+ J- Z3 R3 b, S- t* _

4 u4 g* A$ G! A7 ]  v" uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ S% X7 F, J  d5 q( e4 q; `
( c+ x* i5 U* E- H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. x$ K  d6 s' z6 x2 i9 W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 x( j# W" e' m2 `; S4 m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 B' w. Z/ M9 K. n5 h
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ n, X) x# [9 l1 t# \* N
begin P_induction arriving
. G- Y" V3 {0 Y* @- L& [    clone 1 load to P_pick(A_induct)3 g7 M; a0 Q8 k6 r
end最大的系
( x. L" i$ K0 K: M6 I4 R7 @6 I, v) m) {
begin P_pick arriving' |6 Q8 a, G. K  M
    set A_i to procindex * 10 + 1, N5 B1 M: J" s2 J# f
    move into Q_induct(procindex)
! ^4 K* S9 U# v    move into pickaisle.induct(procindex)5 W' Y, k' s; F$ a: y7 P
    /*check the type of pickaisle.induct(i), for your last problem.*/" {! a( S* P, z9 J0 F

, y2 _5 r1 o' C- d+ }    while A_i<=30 do begin4 c( Q9 g2 E1 R+ p1 t) W% U
        travel to pickaisle.con(A_i)( _; G3 H- M0 c2 p' p0 L. S2 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: L- C- x5 @: g1 T% s- b+ b        else wait for 10 sec  {- a$ T( [$ i8 l* r( f" w
        if A_i=A_leave then send to die
1 D, b+ _9 K. P, I* Y        else inc A_i by 17 q- [4 [4 |9 [2 [  p5 M% q) S
    end4 ^( e7 o, k" a0 L5 H2 o: y
end
; @5 i  A; A$ R8 J; _+ n$ j2 G% s; t! v9 g1 J" D
其中的procindex为整形,代表当前process的序号。7 x' W) U3 R7 a& C5 S
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-8-6 10:18 , Processed in 0.014759 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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