设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12349|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 g2 D  [9 F1 }7 W
' z5 R& @$ j  o$ u我的问题是,在每个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中的数值,不知道会不会有什么不妥。' f8 u, @/ p8 s, k; W. W

3 L& l& n9 L7 g4 M+ Q1 W% Vbegin P_read arriving
& j8 X$ v+ B$ C) m    while 1=1 do begin
) M4 j4 z4 q% \5 b5 Z; I        read A_tote from "data.txt" with delimiter "\n"2 O7 g$ s4 F6 P8 m
        read A_time from "data.txt" with delimiter "\n"
/ h2 V4 U1 O4 O7 T1 A6 ^9 L* V        read A_leave from "data.txt" with delimiter "\n"1 O% [4 T) ~6 d
        read A_picks from "data.txt" with delimiter "\n"
9 S: R/ H( m6 ^        set load type to A_tote- ~3 r! G9 d8 M0 t8 y% S6 e
        if A_tote="tote 1" then set A_induct to 1
' J8 A. A2 B3 l$ ]9 T' E& ]        else if A_tote="tote 2" then set A_induct to 2
4 S! I8 v+ O5 Q$ a4 e+ u) ]" X            else set A_induct to 3    1 t1 w! N: u$ |/ g0 ^
        set A_i to 0
  A9 z2 ?0 r8 h9 }9 r: p        clone 1 load to P_induction
% f" U$ }& P$ X1 U/ ^        wait for A_time sec5 Z8 T; u% z# f0 P
    end; b/ ~! q: T/ M, f) ]
end
! Z- H; R7 w) C& Q! i
1 K  A* D$ D9 Q* bbegin P_induction arriving
- `: u% S; H: s7 W    if A_induct=1 then clone 1 load to P_pick1# `9 W. G- I! b( b* c+ Y$ m
    else if A_induct=2 then clone 1 load to P_pick2
/ @5 Y7 i0 R! Y8 Y1 n        else clone 1 load to P_pick3
. Y; X4 T& e! a, ?& c& @& jend2 E- ]: @% O+ P1 q0 u. ?' u
  v9 _2 ?8 U8 R
begin P_pick1 arriving5 A+ U4 ?3 B; M2 L9 G0 l. V
    set A_i to 1
, x/ l) ?, \* v    move into Q_induct1
8 u+ p$ T0 ^! z0 I5 Q    move into pickaisle.induct1" B% V9 \% P  y7 T. y7 q& Y
    while A_i<=30 do begin4 c& r: U/ `9 \% d8 A/ d+ s
        travel to pickaisle.con(A_i), ?7 O0 @1 `$ B1 Z6 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, m! e2 v7 h& [8 W6 c
        else wait for 10 sec6 B3 g! ^2 j7 v& J7 ?
        if A_i=A_leave then send to die: P# j: c$ H9 B) Y0 Q& i% a
        else inc A_i by 1- ]0 \/ x" v0 f7 G$ u% p
    end
7 `  q# d) _8 `& ?% g9 Tend
# U  I0 I4 b! T* v6 l( E$ Y# r% i. g& p2 T3 X' l
begin P_pick2 arriving1 Y7 e% |- d/ g( I+ p
    set A_i to 11
, y5 O5 J& E) R/ ?& W0 a$ J* i    move into Q_induct2. p" L" H3 L0 q' m- H* `, k! F
    move into pickaisle.induct2" W- n6 B8 Q1 Z) D
    while A_i<=30 do begin
+ W* z5 E' B7 B* w5 G8 h3 h" ]2 z        travel to pickaisle.con(A_i)
+ F9 U5 y- ^3 \. M- X+ ~2 d. C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" j5 J/ o) G, o1 {& }; ?
        else wait for 10 sec. x) J. q) Z, X# ~$ e- p0 j
        if A_i=A_leave then send to die8 L. o* o' y4 T) h
        else inc A_i by 1# p4 C0 f3 w9 g; M
    end
4 B, l0 o+ `1 I7 A3 p& I) Uend
# }4 p7 Y/ l0 \+ M  R3 H: R) Q8 ]8 x2 D1 S$ k' y8 E
begin P_pick3 arriving2 m% R- U' e7 A! A6 V  v& ?
    set A_i to 21
" _( X& |, Q6 \    move into Q_induct3
4 h6 Q1 a. L( L5 d    move into pickaisle.induct34 ~$ x6 d% n6 ?/ s# z
    while A_i<=30 do begin5 o, _0 d6 J* A
        travel to pickaisle.con(A_i)
) q4 V9 h8 z) J) I" g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 l$ D4 q3 M! l6 I9 l6 Q
        else wait for 10 sec
, b2 i" s! I# b$ C& U2 f, r5 Y/ x        if A_i=A_leave then send to die
# Q# x7 _' }. P/ B5 Z# s! y) G        else inc A_i by 1! u0 \6 a: G. }6 c2 I
    end
& z: v) y4 |- ]7 d# c- W9 [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是个什么东东?
! D+ ]( e- L! Y! Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; H% Y( k0 q7 C
: F. X' O; y, K6 S, x- \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: }3 K( n2 A3 T4 D# P
! X9 n& O+ S4 e8 b* b  k3 [
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 U3 P$ m! Q! p# r. r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ W1 F0 D. b# T& f! k% Z4 F3 W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ j7 R: S  Y: d5 o3 L( _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* }7 G4 J+ ~7 B0 zbegin P_induction arriving+ m9 b/ @; d& G9 O8 x$ B# s; ]; W
    clone 1 load to P_pick(A_induct)
4 P0 r  J8 |) S9 l( V2 ?8 ]end最大的系& Z% W: o4 ~" z2 G
3 p% R% x4 S/ M8 ], s
begin P_pick arriving
5 Y5 p/ V: }. K, T& S( \' z    set A_i to procindex * 10 + 1
+ h$ _% {4 \" f) Q7 |) o1 X    move into Q_induct(procindex)
0 |2 c2 V6 M+ j! p    move into pickaisle.induct(procindex)& y: C4 e3 X- n0 l. E
    /*check the type of pickaisle.induct(i), for your last problem.*/" V1 D" ^5 P4 Q& f
" U7 e* I$ D8 i, M7 i, _& S
    while A_i<=30 do begin" s+ a) u) Q# O4 [0 _) C0 l1 G" p
        travel to pickaisle.con(A_i)' |5 u4 ?6 ~# I. q: t3 |8 D4 T# p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* L5 [% m0 X! w. f. b4 D        else wait for 10 sec& y, f" W; f) s$ G0 L
        if A_i=A_leave then send to die
$ L# B; d8 U7 v3 g% v  F        else inc A_i by 1
' ]/ l' P& c' |    end
! @: y4 X3 C0 xend
0 L' K: X( d* v! m3 N; E% U9 o& Y" ]+ C9 w
其中的procindex为整形,代表当前process的序号。
  q9 V/ a* F) `& Ystation和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-1-16 14:05 , Processed in 0.018361 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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