设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14730|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 Z4 n& Z  n- p3 @% \

4 }" ]; z  B/ P3 L# S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ U# C( Q: {; F; u# `. Z
8 K( T$ g# p; Z4 G* p' z6 {begin P_read arriving
6 S2 K% m, i  c  g    while 1=1 do begin" ~. h9 u. h/ a) u
        read A_tote from "data.txt" with delimiter "\n"
4 C4 k5 K/ c: K6 h0 ^7 b/ R# N, K7 u* J        read A_time from "data.txt" with delimiter "\n"# \- u9 W* a" N& t* O
        read A_leave from "data.txt" with delimiter "\n"
; g: j6 P% k+ p1 d, B8 P        read A_picks from "data.txt" with delimiter "\n"
. B. }, Y" X4 `: f9 ^        set load type to A_tote- p- d$ j  Q2 t) t7 n* G0 |
        if A_tote="tote 1" then set A_induct to 1
% u8 |# g6 f' u1 L  P) R7 b        else if A_tote="tote 2" then set A_induct to 24 `+ ]5 t5 Q5 K2 B+ R4 ^8 G
            else set A_induct to 3   
4 E6 N9 |  e0 E! t, O        set A_i to 0
/ m2 B! L4 D7 q, O: a        clone 1 load to P_induction
. f- v% n- t" A) c5 X, d1 h        wait for A_time sec
- m5 @8 w1 f2 M/ b    end
5 w) U, W# K+ w2 C! s/ w* d. Qend
$ M: {  l  H" p  @# d7 G- w8 m2 i
- \0 p# U# y% q8 F( G) a- sbegin P_induction arriving3 Y4 U& |5 Y. E; l/ w0 Y
    if A_induct=1 then clone 1 load to P_pick1. [0 m$ m6 \! B. N5 i" H
    else if A_induct=2 then clone 1 load to P_pick2
( N; Z* N; T6 o* A4 G/ y8 G        else clone 1 load to P_pick34 C- r/ F3 [# x
end
! |! @0 Z' l1 o! K
6 h6 M/ t5 T( ybegin P_pick1 arriving
- u# x2 t) I: Q( `    set A_i to 1
& p& @; z8 J( [, \) `! }$ l6 x    move into Q_induct1
3 r7 V- p5 ]  B- }6 a    move into pickaisle.induct1! F5 Y$ U; M' n: ]4 ^
    while A_i<=30 do begin' v& H" {3 F/ u( M- }
        travel to pickaisle.con(A_i)" `9 M. ?% E, p# k4 D# n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: o5 L# c( h/ c
        else wait for 10 sec
; w. Z" x5 e0 d* b+ t' ?% M        if A_i=A_leave then send to die
. w& t* t. X- d1 A        else inc A_i by 1
  L: b" H7 W% C! b6 M  j) z    end7 ~% ?! V* ^: h$ P6 c  v2 p
end
/ o8 G. ~' q" {6 r0 Q' r" B
8 l* |' n# a9 N; n9 cbegin P_pick2 arriving: D& ^5 U/ h) j, m
    set A_i to 11
3 T* E/ x/ v" b3 s# S! @$ z    move into Q_induct2
# w7 u6 R+ ]1 p+ L    move into pickaisle.induct2
+ q; t' U" i9 K' Y" C    while A_i<=30 do begin
* J+ n$ P& f* P: b        travel to pickaisle.con(A_i)
2 R' m. F; ^7 p( M& ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {! q% h  M; ?* y$ _
        else wait for 10 sec* F8 Y, S- E0 h% q$ S" C
        if A_i=A_leave then send to die
  E  [7 ~, [  K* X. ]- A: Q        else inc A_i by 1
3 T! `, q) F( k2 ~8 b8 q    end
' A- U  K6 j; S7 I% C* Y; Hend1 T" K) |+ Q2 a0 G' F4 R# l: N( K
5 r& L: T  G/ }! A
begin P_pick3 arriving
1 E/ h( @0 D2 t: f    set A_i to 21
: K  I0 M9 X( o( X2 U* t& \& ~    move into Q_induct3
& q* u$ d0 {# M' x    move into pickaisle.induct3
$ {" y9 G0 U  E* x    while A_i<=30 do begin( m' Z2 g4 T  _
        travel to pickaisle.con(A_i)
' J. ]$ Z% @, I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p$ k- s( R) `3 A        else wait for 10 sec
2 U& s) B5 a% h" N- k+ k        if A_i=A_leave then send to die% k1 W; o- B& J
        else inc A_i by 13 S3 O1 U) r6 g: @: x/ C( r7 n
    end
1 ^  r6 |1 X, G! cend

最佳答案

查看完整内容

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' H! Y9 j% G' M% g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 R/ `; t5 h; y; ^" X" U4 m9 n
' M5 E/ n6 ]7 zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" g0 t7 X  `* k' Y

$ O$ }" V4 k5 d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. r. a, B) ~0 ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ b# d+ w; r$ N2 q. S) @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 S- ?4 J; G+ {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 q! E( C: g, Gbegin P_induction arriving
* t$ h( F1 C* B1 |! n    clone 1 load to P_pick(A_induct)
5 I' A8 _# @2 k& N2 g. Y1 Nend最大的系
- V6 y" P4 `3 A. }! [. [
- A4 h- Y! k1 N9 D) e7 f5 y7 \. Rbegin P_pick arriving
( G  H! s" o' [  {    set A_i to procindex * 10 + 1& r) T" g+ _' ^6 ~* E/ p% F
    move into Q_induct(procindex)
- j3 _* m. ?& \+ K6 h( M4 [* T    move into pickaisle.induct(procindex)" Q( ^+ F3 Z& X7 t! n
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 v: B0 V/ `) M7 o; a8 B, |. c
7 [! B/ v- Y! R" s    while A_i<=30 do begin
9 C  g7 C+ Q( }% v% Y( E* z        travel to pickaisle.con(A_i)
3 y! @% L" N6 k) D/ b6 j' C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* A* D9 |6 R1 e        else wait for 10 sec
/ h8 R2 g, n. a5 ^5 n1 n        if A_i=A_leave then send to die
: K4 e1 t$ j# b$ `/ E) @  L        else inc A_i by 1
, A+ q  b5 |2 d7 G1 ^- a7 l( q    end7 v6 Z1 w' P: L0 w9 U; C8 k
end
2 {1 B. v1 X8 h! ]2 y6 [. R. |" R0 y8 N  O% S  D
其中的procindex为整形,代表当前process的序号。) K1 e9 z+ W; ^# F+ p5 U
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-24 00:26 , Processed in 0.014577 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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