设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13335|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 g6 Y" v  g8 u5 _

6 R* P% J$ ]# a) O' o我的问题是,在每个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中的数值,不知道会不会有什么不妥。  O8 r' t: S& N* e9 O

0 M" ]2 x* a, e, p5 T; d! T5 P8 ^begin P_read arriving4 F- ?4 g9 T6 x& _
    while 1=1 do begin
. u% I& I( _+ Q        read A_tote from "data.txt" with delimiter "\n"
* L$ U7 D) m* l/ f/ j0 Q        read A_time from "data.txt" with delimiter "\n"5 ~5 I4 ~( T+ e* m
        read A_leave from "data.txt" with delimiter "\n"
- c: `2 c& A$ ]        read A_picks from "data.txt" with delimiter "\n"
6 n' N6 w7 J, p8 h. z! v- E        set load type to A_tote% B7 K: j" |. W9 d: S, L! `
        if A_tote="tote 1" then set A_induct to 1  g& e9 t/ e4 s# P
        else if A_tote="tote 2" then set A_induct to 25 F8 u" [9 h; e7 i  F" k' T" C
            else set A_induct to 3   
4 |; I* o9 t# L$ B4 M& r; P        set A_i to 00 `) d6 o  L- y2 m0 Z9 i) b5 Z
        clone 1 load to P_induction* D3 Y8 [6 e0 F; p7 n8 d; B$ k
        wait for A_time sec+ z; J0 {) H* J
    end
; D4 o4 G% ]( V$ xend
  c; \. h# @' c# ^& h
- S1 O5 P' \: \1 Zbegin P_induction arriving
8 u2 \) u1 V- ~7 \5 j& o  [    if A_induct=1 then clone 1 load to P_pick1. @) t, Z: S+ H
    else if A_induct=2 then clone 1 load to P_pick2
  I. W, d% b, Y  O        else clone 1 load to P_pick3
) }. J7 f3 {# j8 _end' A: }! R* l1 ]- C1 T" m

4 ^4 H9 z* W9 t, n2 bbegin P_pick1 arriving
4 A( v, o; ^* K    set A_i to 1
/ n& f; S( |0 U* y/ H    move into Q_induct1+ D: `2 Y7 r3 R
    move into pickaisle.induct12 ?  b. G: L1 |& o
    while A_i<=30 do begin
3 F7 t# o* {, l/ Z        travel to pickaisle.con(A_i)9 @( P5 u, @# ]1 d5 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 S: j! Y& d  f6 d1 o( h& B: P" F        else wait for 10 sec
6 i1 r& {7 I0 S. p        if A_i=A_leave then send to die
# P% i; d7 o0 d% {0 \( F        else inc A_i by 1, R& ~2 c( N- p) C% o
    end8 \! ]( j+ @% K6 H* L
end
5 f. H. d& v- d1 g# `. g% p7 {5 @/ x7 E/ H
begin P_pick2 arriving
9 Y" N" H" ]6 j    set A_i to 11
$ e9 N6 `6 ]2 c% _    move into Q_induct2& ]: L3 ]6 C) j0 `
    move into pickaisle.induct2
: o9 g) e6 }, O! L; {5 H1 i# R    while A_i<=30 do begin
6 Y- v3 q; R4 E: Z# Y; `2 q* u5 i        travel to pickaisle.con(A_i)
3 h( j! p2 V! F) W% l4 o3 L) _6 M/ m) e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, j8 t0 Z9 Y8 |/ o- D' @1 \" G
        else wait for 10 sec
6 P) u& W& H( \( q        if A_i=A_leave then send to die4 r+ c) P: S) u: |
        else inc A_i by 1. X- @6 f! e& R' Y) U' U9 V
    end
) i( O3 T' t: c/ `! ~+ send
$ |! ]- U' J3 f$ n5 d; M# m+ y, w+ ^
begin P_pick3 arriving5 |3 K- i4 I. N0 P" A# v: [& d
    set A_i to 214 }" u$ w5 E, i4 \. C
    move into Q_induct3
! G0 k  {9 I4 f9 z+ k    move into pickaisle.induct3
* \& b7 t! Z8 f# y    while A_i<=30 do begin  \7 ?6 d9 F& S/ M/ L
        travel to pickaisle.con(A_i)
1 M+ B7 }3 p- Q2 W: t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, z4 h1 x' P$ ]+ ?        else wait for 10 sec
4 J% _5 Y4 W3 B1 u        if A_i=A_leave then send to die
' S" G+ w: a1 i. ?  V: Z0 [, q8 ^; K        else inc A_i by 1
, [; @( X% z4 L- v" X% v: {    end' O/ f, ]: |, m7 ~1 p
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是个什么东东?
( ~, e" t- w$ ^% \% B' g% Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' I; ~- y: \" o) E5 n* J7 c4 g, X
+ o, K2 ~9 C2 U4 h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  B7 V1 A6 K, A. W/ s% G6 b: z2 A& U; T% H' e, E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' ~7 `# p$ Y# m. g" S  e$ `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ c9 w- a4 M3 e9 a& s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. P0 g8 m0 i8 p9 I( F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 j7 T" @- v, v9 a" `% Sbegin P_induction arriving
; G( W4 |7 v, L% V/ C    clone 1 load to P_pick(A_induct): `2 A" R7 Y1 N1 s
end最大的系
: v* P# S- K) ~. C, w( y
- r! w) }% N4 x9 i( D1 H  Y4 W- @) Gbegin P_pick arriving$ U( o5 D8 W& z
    set A_i to procindex * 10 + 1
" z% P) K% o+ ]0 x; }/ F    move into Q_induct(procindex)! |8 z. X% Z' n' p- B* ]
    move into pickaisle.induct(procindex)1 v1 w+ l6 c- U' \/ g- \
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ s1 `9 ^; E+ @# e" C+ Q$ J7 v
! e9 x9 o7 l. ]* |    while A_i<=30 do begin
. ^8 R2 L; P3 x* e$ R        travel to pickaisle.con(A_i)9 X& A4 L- U+ c; b' V4 Y- A& r2 o7 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ]9 J1 Z, U) p6 s6 w9 b
        else wait for 10 sec
7 [# b7 J/ r9 Q  Z6 I! _0 G        if A_i=A_leave then send to die
* z* J( d, t* @0 ]3 f        else inc A_i by 1
1 |- |  }1 h: Z8 b- U    end2 Y) V$ l' Q9 e; t& z+ r& J
end
" J2 N1 Z3 C8 J5 q' L! r5 R4 I
( z2 S0 S2 G8 a其中的procindex为整形,代表当前process的序号。. I) w$ ?! u! A6 H( M
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-4-5 03:49 , Processed in 0.016343 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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