设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12793|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ E3 k- }5 s5 p/ b  J) M& F
9 x7 ?" ]) p5 i! N  s8 r* M, o% D  e
我的问题是,在每个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; t1 ~& k; n. B3 n4 W1 s  v
* n' O# J' Y3 a9 |! Z9 x7 r9 A
begin P_read arriving1 j7 u  Z5 ~0 g( k, Y0 i" Y
    while 1=1 do begin6 t! p5 }4 Y7 C1 Q
        read A_tote from "data.txt" with delimiter "\n"
+ U+ A" X& T1 q& l        read A_time from "data.txt" with delimiter "\n"7 z  \, F0 @9 L) y- V, L7 r! c( y
        read A_leave from "data.txt" with delimiter "\n"
+ P/ b% Q/ B0 v% w0 q, w1 X9 B        read A_picks from "data.txt" with delimiter "\n"9 ~& P2 T. L" X% l+ j
        set load type to A_tote
7 A- O; D; R/ ~: V6 z% Y( J        if A_tote="tote 1" then set A_induct to 1: m) D3 I& ~) p6 S* C! B
        else if A_tote="tote 2" then set A_induct to 2
3 }2 H9 U. h" L6 f# j6 @' P+ Z            else set A_induct to 3   
& E! @2 n7 c9 E. g7 z& s        set A_i to 0) O& [$ }( H! n: \3 O
        clone 1 load to P_induction
" t, G: h, I# ]) e        wait for A_time sec
/ b3 v0 o" D5 J5 r* w. @2 ^- ^    end
' b% I4 A" G7 m7 W6 s8 z) Qend
9 }8 C6 t: L  o
# j) C" L9 x% z( s3 M* h3 `begin P_induction arriving4 c( W5 }  Z# R' c) v0 z+ I! y
    if A_induct=1 then clone 1 load to P_pick1
8 u7 o# p5 M2 [6 z    else if A_induct=2 then clone 1 load to P_pick2# M/ V7 ?/ P5 D* n$ |
        else clone 1 load to P_pick3
+ \* N$ V4 I6 P9 ~; [end
! b( H- a* V* r9 `" L* p: j* f
( H4 j; |( s# z# @9 ~begin P_pick1 arriving
2 @( m, u9 ?. ^4 p: B; _1 t    set A_i to 1
0 E. Z- E$ K& x3 R    move into Q_induct1; W" Q. \: m- y! B, E1 v
    move into pickaisle.induct1% Z% B7 \1 ~6 Y" @
    while A_i<=30 do begin
$ E4 N7 o2 O- q5 h- m7 b3 U* o: z        travel to pickaisle.con(A_i)
" V# e5 t1 F' |. X! C- z: ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% w2 h  W' t6 A: i        else wait for 10 sec) w: ~4 u' Z* q  V# f) h
        if A_i=A_leave then send to die. l6 S% r" l5 }  l$ b
        else inc A_i by 1
5 K, D& y5 r! g/ c8 @5 j    end
2 q0 h1 O% W5 W; ]5 I- a- \end& n, H! B+ l# T! L1 Q

. q# b& [% S- H7 ^begin P_pick2 arriving
& E: U5 x" I. F+ K) ~* ?6 P( u    set A_i to 11
+ S" G# ?" w$ x# e    move into Q_induct2
7 w! i5 f0 @7 n    move into pickaisle.induct2
' F) |  t& f' {( P, [* L    while A_i<=30 do begin7 P4 W- ]& Q; A) n. k
        travel to pickaisle.con(A_i)
. e+ t; T. @8 X) w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- R- q$ a6 D+ {! w6 N
        else wait for 10 sec
  ^( {0 Q* P8 `& s6 Q2 R5 W, V8 g; S6 M        if A_i=A_leave then send to die! n) f$ O5 \3 E  K9 A" E, N8 o. i
        else inc A_i by 14 v  o' l7 b- h; ]! g& a
    end; q+ @) b! G# F3 A8 Q  Z
end
/ z* Q4 d* F* w, m/ b) R( @1 K1 U- Q" d: Z' x, F1 Z
begin P_pick3 arriving  {2 ?" _" ]5 ~! f1 B4 X
    set A_i to 218 [5 a* t3 N9 n
    move into Q_induct3: k# B/ D: a! f7 b7 X& U5 ?* `8 p
    move into pickaisle.induct33 \$ `$ B! d' R* J7 Y
    while A_i<=30 do begin2 x& r4 ^7 ]9 H! K
        travel to pickaisle.con(A_i)" @/ Q9 j4 H4 |5 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ p; o; }& w& O% x9 ~  j: b5 N
        else wait for 10 sec
5 N0 j% ~. r0 p4 h+ o2 v3 u        if A_i=A_leave then send to die
7 [6 D' G  R$ A9 q# W* m        else inc A_i by 1
: x% ^8 L& e" h9 }! S    end
" k+ d3 D% r( Q0 K; eend

最佳答案

查看完整内容

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是个什么东东?2 Y) l7 }, H  V" @( L4 _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 T: B, T& o& W
1 z  m# x+ C% U- I: DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: s' F# q% Z5 }6 t4 z+ P3 a6 G' m

* ]  a- L! a# U2 d0 Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 M- B" b+ a8 U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, H; ~! ?! |7 n% C  x! _1 k- N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* ]' Q4 d. o8 c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. f) J; s5 ]" ?) j# q: T5 Tbegin P_induction arriving& C1 r. e! J  t' @/ y
    clone 1 load to P_pick(A_induct)
; d5 S, @5 x9 M+ n3 D" cend最大的系
( q; @5 C: m* M( k, ~! V$ w/ R) K" L' R% |
begin P_pick arriving
, @6 L4 Y' p" _7 c3 h. u% g; r    set A_i to procindex * 10 + 1
3 ?' [: t0 c! _5 A    move into Q_induct(procindex)
' B' Y" K& d6 u* H, ^8 g  m1 o    move into pickaisle.induct(procindex)6 \$ Y9 @8 r8 s1 t' e$ I% l* l
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 v2 r8 u' o. j- t; L8 \
! Q0 X( T/ L) S8 ?. ^  t9 E    while A_i<=30 do begin; d9 ^! b) q/ X  w3 k$ p6 G
        travel to pickaisle.con(A_i)
1 C0 x- T! s0 i/ w1 ^& k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 v; X2 @% U% }1 G4 d3 p+ K        else wait for 10 sec) Y8 p& e* i5 O/ f4 ^
        if A_i=A_leave then send to die- @" J& Z& K, H' Z/ S! `1 W1 C
        else inc A_i by 1
: |1 [, L# t. M7 z& f    end* a. n- _3 U9 s' y4 P9 e5 S
end
* B4 c# r% M/ {1 T! U" X, g/ h6 M% @0 g3 F- h
其中的procindex为整形,代表当前process的序号。
! ^9 D/ y' ?  c# ustation和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-2-21 13:48 , Processed in 0.018489 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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