设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13748|回复: 2

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

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

2 V' u/ V2 M  b% ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 u/ J( u1 X. x$ L1 A6 T. n& `0 R# a0 y+ _$ w* L% j& p+ c
begin P_read arriving. \7 Y) V2 f9 j! P. U* b
    while 1=1 do begin; y8 Q, V- D1 t/ n
        read A_tote from "data.txt" with delimiter "\n"
- V4 Z/ M! W' D/ D        read A_time from "data.txt" with delimiter "\n"
# F- u# B* J; g5 @        read A_leave from "data.txt" with delimiter "\n"1 M/ A" O- @1 a' v2 `1 z3 ~
        read A_picks from "data.txt" with delimiter "\n"1 [& G/ n' W# W( n1 ^0 q
        set load type to A_tote
$ b  f+ H* V+ ^( W( T+ V+ k( T        if A_tote="tote 1" then set A_induct to 1
, A0 C' x7 x. t' s& T        else if A_tote="tote 2" then set A_induct to 2
9 ]2 s5 ~  y) z2 h            else set A_induct to 3   
. K  w" e$ K9 f! \; x" K* D0 y$ T        set A_i to 0
: `7 f" w2 }, [1 z        clone 1 load to P_induction
# \1 _6 K! L& R2 v. E# S        wait for A_time sec* `0 ^# R- E0 v6 S. Q6 M
    end
! k4 @+ E; \$ nend' o( z3 }! X" s/ \3 ]
* W* g- x. ^; O. g& }
begin P_induction arriving0 y7 n$ M* g9 {9 F% D1 M
    if A_induct=1 then clone 1 load to P_pick1
% U5 z( `5 b/ W. b2 i4 V( S, `    else if A_induct=2 then clone 1 load to P_pick2
! e. m' G1 U2 z* w4 u        else clone 1 load to P_pick3
8 q$ r( t  x6 |6 L! P+ d& P, D, eend& S6 c% t* e; J  C- C% z
3 C7 r$ h$ V0 \- w' H/ R. ]
begin P_pick1 arriving8 G/ ~2 n7 S9 L3 Z6 S* v% c
    set A_i to 1
9 R: f- D" _% b# X- H+ s+ R" @* X0 h    move into Q_induct1
! M. L6 ~4 f& u! p- k7 `# T    move into pickaisle.induct1
- D) J: {1 `- r2 k/ A    while A_i<=30 do begin/ M) e, U) S3 `' {& J5 F0 X
        travel to pickaisle.con(A_i)
3 ~; ~1 f7 ?2 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: S' i1 F; y% x2 B  M+ B) x
        else wait for 10 sec
2 y' z/ }& N  m        if A_i=A_leave then send to die& L: G, M: L# {
        else inc A_i by 1( W  A) d+ e, Y
    end6 c0 _: [1 O) E. p2 n, V  z
end
0 v2 h, Q% k, V7 L8 j: E# j* I9 l9 l6 g5 n; n7 a- T0 G- U
begin P_pick2 arriving
. @6 }3 s  U' K, k' I3 ^; R6 ~, N    set A_i to 11
& C; Q  z) Z9 \    move into Q_induct2
: _4 E1 ?0 k$ r" h* a/ F1 a2 U    move into pickaisle.induct2& X  b5 P/ T  a2 A- O
    while A_i<=30 do begin
% i# [# G, V/ j) p  S% J9 N( R! d' u5 c' v        travel to pickaisle.con(A_i)$ D' k* \) Y0 C* \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! q4 f5 f7 X1 K( A* C        else wait for 10 sec
2 K; S+ ^& e* _0 D. {& s        if A_i=A_leave then send to die! n* T% A% h2 B7 h" j
        else inc A_i by 1
) h8 a+ @% I! _, H2 G    end
1 ~6 ?) I  b+ P( J3 eend+ E! {( ^5 Z5 D' i& C! I
9 z8 Y2 U7 s' C
begin P_pick3 arriving
* S! c( C1 t0 B6 S. |8 X    set A_i to 21. g1 O) T, U7 c* m0 R
    move into Q_induct3
4 N5 f' ~0 C9 T/ j9 {; l    move into pickaisle.induct33 V6 f3 p' a+ L1 ^2 r2 n1 N
    while A_i<=30 do begin3 _- j$ z  K) j+ [5 e/ u
        travel to pickaisle.con(A_i)+ e: h! ^3 U* c* ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 P$ f, a  c1 U% E/ k. k
        else wait for 10 sec
; L# d  v! K: D; I        if A_i=A_leave then send to die. O" v; O$ _( M# ]3 O3 ^
        else inc A_i by 1
, Z1 ?0 M% E( X& X* Z9 T    end7 v; J" y3 n  F' K# t% d$ `) h
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是个什么东东?6 v$ |/ z5 i9 s3 F" M! {7 x$ W" C! Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& |- Q5 m5 ^1 B) o% z4 f8 G2 N- \6 X! u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# H0 G( F- ~3 n/ m% H8 j* e
# S" O, {' U$ m! P7 [
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 P2 f( \( X0 Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 J* J: F4 O* q# V9 r( y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; i( ]3 K3 v& c! O, t. n/ a% n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 |* D! a! C  x. G1 ]% ]begin P_induction arriving" @" I, i8 X: ?+ H
    clone 1 load to P_pick(A_induct)
! |$ q( `5 Q0 c* Eend最大的系
! U0 L6 P& c* t# f1 y4 i7 N+ W$ f+ _* B# J- Q, w
begin P_pick arriving
5 {$ ~/ K! }( F% W5 F8 L    set A_i to procindex * 10 + 1$ I9 n% v0 K) J) T0 F" X8 Z5 g
    move into Q_induct(procindex)2 V+ p9 Z$ {5 \" ^- O: d4 _) G
    move into pickaisle.induct(procindex), H  y$ f& |. ~2 E6 {7 P
    /*check the type of pickaisle.induct(i), for your last problem.*/& {  ^$ v3 G+ h4 D8 n1 `
" M5 K" S5 e6 y. V5 `* H7 l5 a
    while A_i<=30 do begin  V0 {1 z! E4 o7 ~
        travel to pickaisle.con(A_i)
* ~# Z( B+ b. U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; r( }, d+ b( m4 t
        else wait for 10 sec$ Z/ t, c: j0 O2 n
        if A_i=A_leave then send to die( a& n5 y& e: r8 S( o. a5 i! t# z
        else inc A_i by 17 O2 E& ^) ~5 D: ^; _1 i4 l
    end
4 x% Y/ q6 e& }& M0 c9 p$ F1 nend3 i* j/ A5 ~/ A
  I5 r& s, \* }8 ^5 b) `/ _
其中的procindex为整形,代表当前process的序号。
2 d4 k# A+ u$ M' U" |4 i8 vstation和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-2 18:44 , Processed in 0.020526 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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