设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13892|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" n. f/ P8 h1 M- g" p$ H( L
. M8 u+ X+ Z$ M. h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 S# Y' k, K. |4 H& Q% ^) S2 M5 ?0 ?+ r( q- V% A3 _" {
begin P_read arriving
7 R) I* A) e6 g! q) x    while 1=1 do begin7 j: M* V6 B$ `$ ^/ f
        read A_tote from "data.txt" with delimiter "\n"
2 R9 b! K/ u+ e& r        read A_time from "data.txt" with delimiter "\n"
4 Q8 H, q2 d- R: d  T        read A_leave from "data.txt" with delimiter "\n"3 J: x* ?3 A1 }: b; L0 ?
        read A_picks from "data.txt" with delimiter "\n". A! }& j: P. M* p+ g9 t, Y+ x6 j
        set load type to A_tote; e0 X% E6 K* n1 i0 L% A
        if A_tote="tote 1" then set A_induct to 1
; [+ l8 a  g  z4 q        else if A_tote="tote 2" then set A_induct to 2+ T* H7 @5 l# t3 B1 V3 F# t* s
            else set A_induct to 3   
7 g) m5 A& s. h. F        set A_i to 0
2 v! P( Q7 n* o( n1 |% H$ G        clone 1 load to P_induction( E/ K6 _0 v& {1 o. F; N# h0 q( U
        wait for A_time sec, N) M2 a/ ?' J- Q& d8 g
    end1 r4 e" J. p1 r+ w: g6 r( f
end
5 a7 L0 }4 P# T) o! z
' n! Y7 B% M" g: Rbegin P_induction arriving7 ]/ x. {; F4 ?4 i- I$ j
    if A_induct=1 then clone 1 load to P_pick1+ K# t1 c& k9 G; W) C- J8 x9 ~
    else if A_induct=2 then clone 1 load to P_pick29 ^) O7 c, F+ n$ Z+ ]7 _% w9 }/ @
        else clone 1 load to P_pick3
# ^5 ?3 [8 e& t" |/ L1 a$ Dend
7 l1 w4 v; ^4 H$ Y5 M* ?% }
' d$ l( a$ L1 C( ]: Xbegin P_pick1 arriving
# m4 ^; c! B3 F5 ?* d    set A_i to 1) }4 ~" b0 l- z" o
    move into Q_induct1
6 K4 s0 @; f) ?- n0 W2 U9 B( _' ^8 b    move into pickaisle.induct1" A- a. c) x5 g) H8 U6 T" [
    while A_i<=30 do begin4 t- i' x, }6 u+ W1 _7 {) c  N
        travel to pickaisle.con(A_i)! f; \" E  J5 W; [1 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: H" }! T) l4 @* w4 G8 Z1 k        else wait for 10 sec! r8 f$ q2 Q8 d
        if A_i=A_leave then send to die) C" z+ ^1 m, c: }* f
        else inc A_i by 1
1 P/ n; p" _: z4 k) Z! H  }+ t    end
) ^6 e* ]. y. K6 Rend, S9 p9 O" S; t/ v; \, s, U+ I/ Z
; o- V: j4 e: s% e# D/ ~7 T
begin P_pick2 arriving6 _/ d# n: W8 i) s0 A
    set A_i to 11; k) T: j+ e7 P  A7 k
    move into Q_induct2
; _! k8 P# m1 K# U$ Y    move into pickaisle.induct23 c# ]) o9 ^( @, ?/ [9 z9 j! z
    while A_i<=30 do begin
9 m8 ?' F1 I% G        travel to pickaisle.con(A_i)$ y8 d  `& r* g1 v! b' q- j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: S0 u: g0 c8 F6 E3 K- l
        else wait for 10 sec
* k5 V6 c$ P$ U# l        if A_i=A_leave then send to die1 }* s3 n( Q/ s; j
        else inc A_i by 1
  }4 F' z/ A9 N+ z$ R  y    end
7 L: D+ K5 j6 ^1 P8 R1 Dend4 X; A' f; x4 u5 |  G# O. K" k
0 {6 {9 D7 X" f- T& s# T
begin P_pick3 arriving7 ^9 ~& O# [& J4 X9 J
    set A_i to 21
' X, B9 m  L) R3 p, ]    move into Q_induct3
" A( e; W, J1 v. x  p( Y+ a    move into pickaisle.induct3
+ @2 ^: C" g" }% L5 {    while A_i<=30 do begin
  A8 V0 `9 z+ H5 \6 u# a        travel to pickaisle.con(A_i)( u) m& X0 W( ^" t: w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' t. d8 c# z* d9 {' o
        else wait for 10 sec
- v* i3 s% X4 x6 ?+ P        if A_i=A_leave then send to die3 d# s& _4 N5 f- g" V1 N( k
        else inc A_i by 1
+ _1 X! h+ {, z5 o$ l; |5 V    end7 \! \) F3 A5 T
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是个什么东东?
1 d. D  ~9 I& ~! |* Q. imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 @- y; C! b7 |& k* Y
3 v1 N. t) ^8 x, D/ }/ JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) L8 L8 T$ R% }$ F5 x7 k6 J9 X+ H8 H4 f
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 T! s4 n5 V1 \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! |9 [+ u6 P- T+ c2 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) B7 i; D4 h/ _* I, E6 I" I
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# v* X  l/ |$ H4 e) k4 t2 abegin P_induction arriving
7 ~$ F; Z0 j" d7 j    clone 1 load to P_pick(A_induct)
( E$ ~/ X2 u; [; Q) y3 Pend最大的系4 q% c' V4 Y  m0 G+ u  b9 d% y! X* e

$ h$ w- y1 [3 P% l8 Q% Q- Cbegin P_pick arriving; C' B& ^9 G% Z) c1 o
    set A_i to procindex * 10 + 12 e2 k/ ]0 V9 f; y& c1 E& t0 D8 c
    move into Q_induct(procindex)
. j: T* s- G: a* D8 D) S  ^    move into pickaisle.induct(procindex); H" e# w0 J9 p- z
    /*check the type of pickaisle.induct(i), for your last problem.*/
; }  v5 A) m( e/ V1 S" w/ X" Z& d+ {' J( Y. r* r4 A
    while A_i<=30 do begin! Q/ A3 g& g. \
        travel to pickaisle.con(A_i)
& y" O, H) h0 @3 _' s9 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 k0 J6 ~( V6 R0 O+ z, U) V5 {        else wait for 10 sec
( M4 o  ~7 ]+ p9 o' w        if A_i=A_leave then send to die
/ m/ p, [3 P& H% Y! b3 c2 l$ a        else inc A_i by 14 j- {7 o7 N& l1 S, h
    end
; T3 L4 @! u6 m, Rend  U" u3 n4 j9 T5 t3 b. S; y$ W
! C+ X0 ^0 e2 p8 l' e9 `  v
其中的procindex为整形,代表当前process的序号。
6 _3 p+ _6 U# P/ U& \) 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-15 17:00 , Processed in 0.016061 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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