设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13925|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( N" Y3 j9 d. ^4 E# e7 e
) N# a$ }$ Y9 a  K$ `) @3 @我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* q7 J/ r- ]# e* q2 T
  j$ @7 D+ P) ~5 x+ r3 C' o# Fbegin P_read arriving
1 o& C9 T4 f+ F7 Z  t6 f    while 1=1 do begin, F$ \. \! W+ g! l# ]
        read A_tote from "data.txt" with delimiter "\n"
3 ~# O5 p0 w+ b7 y- }/ B        read A_time from "data.txt" with delimiter "\n"# }) T1 ?: b! a* B* T8 H
        read A_leave from "data.txt" with delimiter "\n"3 }- W9 L) I' h* l. [  j0 l
        read A_picks from "data.txt" with delimiter "\n"
) X. q: z7 y& K' Y0 i! V' z        set load type to A_tote; \% J8 a' @* \$ l7 k7 S
        if A_tote="tote 1" then set A_induct to 1
: c: e4 s. a; D        else if A_tote="tote 2" then set A_induct to 2
6 D; p+ k0 J% |! W            else set A_induct to 3    9 U7 K8 Y5 d# ?
        set A_i to 0' T. b- ~: l/ z) I; L5 x& Q) h# v
        clone 1 load to P_induction
/ v0 \' ]  h$ t4 ^6 A) K! K        wait for A_time sec  q' |+ a" R8 u! i8 A- m
    end
  e7 q, r/ U& J) M, J  Q5 aend0 K; v6 B8 G+ J; f* w; p0 |

7 V; q4 k. t1 M+ U5 sbegin P_induction arriving# L6 c/ }& u$ X5 g% a  O+ N
    if A_induct=1 then clone 1 load to P_pick1
$ {& F* R+ z* t    else if A_induct=2 then clone 1 load to P_pick2
. L5 s1 z/ W1 M& U        else clone 1 load to P_pick3
/ \, R& @0 }/ f1 n8 L$ t+ p7 iend5 e) ]# t/ ?, n; Y

' ~! S% ?. p6 F/ Tbegin P_pick1 arriving
3 v  |! C+ V3 E0 k    set A_i to 1
' _" A/ G- s2 J/ |  G/ B+ D- D    move into Q_induct1; K7 ~: j0 T- I9 p- _, ?
    move into pickaisle.induct1: F% @$ ^. a. y1 B/ e% k
    while A_i<=30 do begin
$ N6 z9 ?9 o! G        travel to pickaisle.con(A_i)
8 s6 w2 c% U- F9 s9 v# Z1 e& M1 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X% ^+ y5 [" D4 L5 ]' P+ W7 [( G        else wait for 10 sec
; U. h8 ?5 n: G' F5 O# t        if A_i=A_leave then send to die
& V# Q) o7 {6 E8 N7 l        else inc A_i by 1  Z% N) {* e5 ^4 Q
    end
7 a/ M9 u' y: f6 n# N7 gend5 u) i. I( q- @6 E7 ]- T/ @

( x+ G# A( F) f7 A% W/ |begin P_pick2 arriving
1 g/ P) O6 K9 S1 z    set A_i to 11
( F4 j# h0 a) _; p) y    move into Q_induct2
) {, {: }, \# X# ?) R! j& V+ s    move into pickaisle.induct2+ I8 g0 s: @9 m+ _- r- G1 F1 J
    while A_i<=30 do begin6 F2 \6 K0 K; L! ]
        travel to pickaisle.con(A_i)
: [" |) b9 f6 i, j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ n5 {7 y& d$ V  H8 N
        else wait for 10 sec
8 L  p$ A3 N& E2 z        if A_i=A_leave then send to die
) \1 x  ^5 E' x& Q% y        else inc A_i by 1- D. T+ w- h9 H, y& M, A7 S
    end
+ ~) \2 X9 k) ^+ tend' b7 g7 @0 @% Z3 y3 s$ J- Q

$ O! F" r# N- V- x5 y$ abegin P_pick3 arriving* m( q6 v: j) |9 }
    set A_i to 21
6 H2 }0 b' z4 l5 Y) B& N    move into Q_induct3
& g$ u: W0 A- @" X    move into pickaisle.induct3
" ?' E( J( S" I  l    while A_i<=30 do begin
  {5 [, _6 t9 r* {7 K+ ~. o        travel to pickaisle.con(A_i)
  s2 y& N( |$ ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 x2 q. @) a' K+ O) o- D: K        else wait for 10 sec; q5 |8 d1 q: y7 y. |" [5 J+ P1 R! P
        if A_i=A_leave then send to die
6 h4 ^. d5 z+ }4 \2 x, c  D        else inc A_i by 1! V' z& j! [# `7 L* a
    end0 u7 [! d% N, B  i
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是个什么东东?" B3 C' ?+ ~( v) A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& a/ c9 X) V5 p: f. F- ~  N
/ r; t9 z+ B& p* S1 d) l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 R0 r4 {+ r+ }# o3 V
+ v- Z9 D8 @( D' I6 t* l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- \; S  y4 k/ v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, s  ^. q' t. S, [9 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: H9 Q8 i# U6 H2 j8 Y$ @6 t
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& b  A5 Q6 ]8 ^) c" O$ Dbegin P_induction arriving
# q& I$ w$ b5 R& q% w( e    clone 1 load to P_pick(A_induct)1 n, |# Y7 z% e( s) |5 O$ v
end最大的系
* d: e7 Q/ K5 e' E+ M0 T1 i( h# l/ r# R
begin P_pick arriving: R( U1 `8 P0 ~% H8 s
    set A_i to procindex * 10 + 1* Z9 [8 p/ O8 P1 f+ \' {
    move into Q_induct(procindex)
4 |5 B! }. P! y) u" s, T. m    move into pickaisle.induct(procindex)
/ P- y+ u& q2 U, u% I' ~. m, V5 N  U    /*check the type of pickaisle.induct(i), for your last problem.*/
. N2 T/ X9 F9 |0 h9 o* ^5 w0 X( b6 v7 L
    while A_i<=30 do begin
* r8 Y- ~! @# p$ I, M1 U3 \$ T$ n        travel to pickaisle.con(A_i)
' \1 Q% u' N9 Y) U& P4 n5 t6 E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" j4 l7 }' T8 B( G  a" K7 R        else wait for 10 sec1 ^  b4 v4 r# U1 h) m1 n
        if A_i=A_leave then send to die3 N3 Q" ?  ~0 x. x
        else inc A_i by 1
. a4 Z( Q8 c# R0 N% b    end
! r7 |/ H- n. w7 P+ E7 z  A2 yend2 n3 ?3 ?; s5 n; }# ~, \

. M# X( I9 ~) }, ^2 d其中的procindex为整形,代表当前process的序号。/ Q& q* c( ^2 ~" `
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-5-19 14:45 , Processed in 0.015594 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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