设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14061|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ O+ H  ?! V1 X& a+ d3 b6 k
: I4 {+ }8 G( f" {' g" x我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 O) O, ^6 l, ]( a* ^

5 ^% p( Z6 P# v: I) i7 sbegin P_read arriving
0 k+ H) N2 O# F' J3 w/ G; r: r4 ]    while 1=1 do begin
8 J0 P8 Z4 n! F; ^; F        read A_tote from "data.txt" with delimiter "\n"3 c8 X& S! x" U9 @
        read A_time from "data.txt" with delimiter "\n"
' i5 t+ X, t) t7 }. D: L+ F$ _: m2 R        read A_leave from "data.txt" with delimiter "\n"
& [' X& ?# N$ M: S% c+ W, U. `0 F        read A_picks from "data.txt" with delimiter "\n"
4 P( T7 V' W. v: F2 Z! [        set load type to A_tote' i: h3 v6 o" R7 q" N% w, ?
        if A_tote="tote 1" then set A_induct to 1
7 F% A6 h' f  Z% \$ `* A7 r        else if A_tote="tote 2" then set A_induct to 2
& ?7 k  h/ n8 q$ z8 w            else set A_induct to 3   
; w- B7 q: Q$ L) d/ n        set A_i to 0
! k7 _5 E% t# C& M# ?        clone 1 load to P_induction
) V! _: i' I' C2 f8 W' y        wait for A_time sec& |1 c% _3 Q& P' _
    end
! ~8 m+ V' Q( ]$ U, Y7 mend
6 J% K  p1 d. }- ^  D! t+ K1 T! E  O7 e. X# c& _4 h9 S1 A
begin P_induction arriving* }9 b% t+ m- v( U1 v
    if A_induct=1 then clone 1 load to P_pick1% ~! ^; N* O1 V
    else if A_induct=2 then clone 1 load to P_pick2
( w- H# D! C* j! c/ l+ w  w# R, a  R        else clone 1 load to P_pick3
3 X* A" _7 f+ P. D6 n# \" ]1 lend# v2 @" x0 r. Y5 j
% T, i, }+ V; Z% d& O8 d: h
begin P_pick1 arriving% r( y. \5 o6 I: c
    set A_i to 1
, s8 A; o  g# p4 i, E    move into Q_induct18 q$ k& w; E9 C# n. I
    move into pickaisle.induct1
0 P8 g! T# `# P" ~6 a    while A_i<=30 do begin8 A1 s5 ]  O9 Y3 j
        travel to pickaisle.con(A_i)
. M" T: j) i7 o! |( n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 P2 Y- \4 n+ U" _
        else wait for 10 sec8 s+ c2 N2 \' z7 n3 ^, f! j& d+ W
        if A_i=A_leave then send to die6 J: L! R0 j: ^  X% v' L' |
        else inc A_i by 1+ y$ k- t% S0 O) ~, v
    end# o: r& W2 l, k+ ^* U
end
. L) y4 _# y1 O2 I2 h
# d9 I' S/ T0 r5 o) Kbegin P_pick2 arriving, I6 |: p" N$ j
    set A_i to 11
* @1 E' H5 W& u    move into Q_induct21 e( M8 t# Z3 d% ]5 ]
    move into pickaisle.induct2  K0 {6 d9 F8 a, z6 m, W  L0 L5 P
    while A_i<=30 do begin
/ s% Q/ ]& Q0 X, B        travel to pickaisle.con(A_i)4 b: c% Z1 J- K: ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ L2 `1 y3 m9 o* p
        else wait for 10 sec5 r( Q4 U( q' d+ _! I
        if A_i=A_leave then send to die
( r# L9 {8 a7 R& t$ c) q1 _  ?        else inc A_i by 1
: F" t1 ^0 }# ]. \# Z    end' N  W2 U  E% ~7 j8 H" Y5 L3 C; ^
end
8 ^( `1 l/ ]$ f% X3 J  a% L* y
1 Z: {3 a, s. S! jbegin P_pick3 arriving. F5 r; Q' i9 \) ]$ E0 f- U' B
    set A_i to 21
# ]( k  ]) b% Z6 I    move into Q_induct3: K2 n# k. F6 U9 w
    move into pickaisle.induct3
4 t/ J& A4 J  N. {  |    while A_i<=30 do begin
' Y! c; m$ E" T& y. a        travel to pickaisle.con(A_i)
- `) J& E# h" U' `' M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! B( Y7 r$ M8 A# U        else wait for 10 sec* I9 E7 J, k% P& O/ v! [/ O) v& {
        if A_i=A_leave then send to die% f5 {: U6 M  x2 h+ X; e0 f
        else inc A_i by 1
, g/ o8 Z: i9 k( A6 {& c' y  V8 V    end
7 f4 z3 K! W* E* Z& wend

最佳答案

查看完整内容

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是个什么东东?
3 y1 U" m" ^+ W% c4 `6 e8 m' j( V: qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ J! M' L0 H  u7 k+ U8 I5 G. v3 S, }: X. a5 M" Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  S8 T' K! ]  t- g8 Q0 \
0 [! H7 g- e1 J/ n) R) d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 w% D; a* O# L. d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* a9 h: C- o1 ~" R/ y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% `! k0 K* g0 t: d% q8 x6 }$ r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ W6 N* Y$ a8 g$ K- a8 Z3 c
begin P_induction arriving. M! C- m) m  e1 ], {4 C$ Y# O7 V
    clone 1 load to P_pick(A_induct)0 i  O' ]1 l  T& Y; T
end最大的系
* U/ Y6 B2 w7 R' {2 D4 K9 w. L8 R4 U' E! B# s7 P  ^/ B0 a( D/ y6 A
begin P_pick arriving
1 x- j- j* j( {6 ^; ^! o    set A_i to procindex * 10 + 1
, L* c+ J2 s# e* Q/ N! j    move into Q_induct(procindex)9 M" o/ R- t+ ]
    move into pickaisle.induct(procindex)0 q- @, Y8 Z1 u; A
    /*check the type of pickaisle.induct(i), for your last problem.*/# I7 G: c* G: j2 Y  Z

2 @9 W6 ?" y7 m  L) l/ f: Y, q    while A_i<=30 do begin
* \" d. d, ?( R        travel to pickaisle.con(A_i)
* [" x9 {8 i! s, V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 r3 I; |* J$ F! K# L8 n. V1 n  E
        else wait for 10 sec
! M5 q& M3 _5 v4 }" w5 F        if A_i=A_leave then send to die+ P1 c: Y# [; }& A+ e' ~
        else inc A_i by 1
8 n6 F) x  q2 w: ?2 t! Z1 t    end
) l& r" y( u9 G& Z% A- M8 Pend
1 j" N! M7 x) j
: A, f$ `" P" P- }4 e其中的procindex为整形,代表当前process的序号。
% l% o2 S$ l- c7 ]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-4 11:08 , Processed in 0.018297 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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