设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14298|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 X6 f) k- k% Q( A) ~7 S4 a& k" R% o0 n3 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 ]! M9 i. w# h. z3 r9 G2 y5 Z5 R6 B

0 h# L( X/ k! Q: h' `2 O+ e; g% {begin P_read arriving
5 H" e% O6 Y' S+ R: g    while 1=1 do begin: m$ J5 w* }7 ]) R  D) @0 E
        read A_tote from "data.txt" with delimiter "\n"7 j* Q" e3 L1 L( w
        read A_time from "data.txt" with delimiter "\n"
& [7 `8 b# C1 W& f4 T  @6 ]; i        read A_leave from "data.txt" with delimiter "\n"
+ S0 W4 ~6 U# S2 ^        read A_picks from "data.txt" with delimiter "\n"$ f! s: m) c0 O- j  K3 k' Z3 R
        set load type to A_tote* \/ L3 a4 F- T4 @. [8 c
        if A_tote="tote 1" then set A_induct to 1
! L3 K6 @5 w6 O3 K4 p        else if A_tote="tote 2" then set A_induct to 2. J( k+ k  z1 Q' N. D
            else set A_induct to 3    & {; i, C7 S1 f& o- K# Z/ H! v9 f
        set A_i to 03 ]) W& F' G9 U9 ?9 Z6 v
        clone 1 load to P_induction
) B% H& R7 E( n; J8 I! M3 v# l        wait for A_time sec
- O) {9 \: _6 R6 H3 h3 c7 o7 l    end' \; O4 r  B5 d+ [$ U; C* ~! n( g
end* H' a, B4 d+ y5 o% c2 S- y2 d

' y2 g9 @( _+ x5 f6 t! Pbegin P_induction arriving
' P( Z" D3 a# {/ m6 {. b- w    if A_induct=1 then clone 1 load to P_pick12 U# f* R* a7 ~* Z
    else if A_induct=2 then clone 1 load to P_pick2
* Y2 ^, N( q- A1 t; l! W, g9 l. z        else clone 1 load to P_pick3
, i7 c( u/ R, i& }end6 s1 a. W: Z; M- K: t

. D6 W- e% b' W# m9 i, pbegin P_pick1 arriving: H4 R9 S5 I, P
    set A_i to 1
# V+ Q) k- W) ?0 u4 @* S; K+ w* M; [" ]    move into Q_induct1
) p+ n" z: A3 y    move into pickaisle.induct1
6 ^/ U9 w  e- ^. X9 L    while A_i<=30 do begin
. d+ s3 q' j5 I        travel to pickaisle.con(A_i)
  Z2 d# V. U  v# b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ _- ], P+ t' E2 F1 j& R) E
        else wait for 10 sec
- J$ I; B- _' b) H( D        if A_i=A_leave then send to die
' f7 g8 U- H2 W1 M9 U        else inc A_i by 1; t1 `+ x% ~8 Y2 q; J
    end/ _! K6 r) q* D' d+ o
end
7 p0 w" K4 Z: T) R
' u$ W5 ]) f8 G% hbegin P_pick2 arriving
5 ?$ J9 N4 J. g) K. E+ o, i    set A_i to 11, @# N& \0 z' [3 u
    move into Q_induct2
0 h( h8 u9 @$ f1 K    move into pickaisle.induct2  ]$ N  C/ l2 L) F
    while A_i<=30 do begin, S8 y9 o$ b5 c; e4 L. V: X8 R
        travel to pickaisle.con(A_i)
; ^' `( k. v& [7 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^% _4 n, a7 D: Z% A        else wait for 10 sec; S, o( ~1 ]: C/ [$ m
        if A_i=A_leave then send to die- X! z+ z. p% i
        else inc A_i by 1
+ I1 l: X  K% b3 R: ^    end# B  B7 r( b$ E, a
end
3 X& i2 U! r6 X2 o3 f
2 c; ^) y3 `2 F. `begin P_pick3 arriving
- f+ _  L: m# d+ O/ }* v# W    set A_i to 21! z) m# L* ^' M
    move into Q_induct3
* C1 j. Q+ e/ P+ d9 X, v- `    move into pickaisle.induct3
8 V, _& t1 W' a6 O. H) x    while A_i<=30 do begin
: R3 `2 Q- F. X0 w        travel to pickaisle.con(A_i)
2 Q5 g4 N  D2 F& @) T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; v% O) B0 F9 `1 e% x        else wait for 10 sec/ _9 E# _* Z) I  `# R
        if A_i=A_leave then send to die
  L1 Y% o# d! b4 E3 e% |        else inc A_i by 11 v2 m* C. h" V- e0 D( C3 Y
    end
4 `  I+ c3 X" k$ w3 U: @  {$ q% }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是个什么东东?
  K2 D/ R) X. I7 n0 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- P  B7 r+ |  Q8 h  Q1 o5 ^

2 m+ r6 R6 @2 a& K% v  p( @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 W; B! y$ V+ R+ x! V/ A: |
" c. [3 l" d* \, r  C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( |) b7 }4 X+ M5 C3 j7 y& C+ w2 A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. J- C# h* \' U7 ^' e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 l7 \: U# {" l) K5 l# n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 ]  k, v* r2 y
begin P_induction arriving/ l5 {# b3 ^$ l7 W
    clone 1 load to P_pick(A_induct)' s; [* ~' @! @4 ]4 c
end最大的系  M% X, \& z6 a, ~) o

, B4 I. j0 [* M- T' Qbegin P_pick arriving. }, k4 e( d9 R7 M3 A
    set A_i to procindex * 10 + 1
) A" x5 \+ b7 m( m% ?/ i: K    move into Q_induct(procindex)
7 {6 [  y5 `" G# j) T8 @    move into pickaisle.induct(procindex)
! \% I- F( ^0 N2 h$ _' ]' ^; U    /*check the type of pickaisle.induct(i), for your last problem.*/
! e. L0 F! {/ x1 r
1 O- \5 V; {5 M    while A_i<=30 do begin
/ O$ Y! [" k1 i/ E2 q1 T  f. d& l        travel to pickaisle.con(A_i)
. y5 }3 `  v* s8 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ^+ w  D3 s+ I' u" E" q2 `        else wait for 10 sec1 k8 G/ U2 c+ s  J6 ^. e: B# v
        if A_i=A_leave then send to die
* L& @" |* i& g1 r0 X        else inc A_i by 1
8 c8 L, {6 @2 O2 Q8 M6 `, v    end* `0 _1 m. x" {7 B7 w! ^
end( p/ z: o' W$ V  x, N; }2 q, {) U8 j

8 W+ c) n, g" O1 g; ]8 K其中的procindex为整形,代表当前process的序号。
1 W6 d% F% L" }" L: a, v- \# ]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-6-29 16:34 , Processed in 0.014299 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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