设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13980|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ e' o# |9 o0 B, O. m- S1 r+ H, m" s9 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; ?3 g5 U# J5 z$ D# C  u4 h4 F$ w* p
begin P_read arriving
/ M$ C2 k4 ~- T* l. ?  ?0 A  Y    while 1=1 do begin
8 L5 k0 O2 M7 T) w* a) p7 Y        read A_tote from "data.txt" with delimiter "\n"
9 c# u" o- z4 z5 ]- _& p7 y        read A_time from "data.txt" with delimiter "\n"% x4 l, A- W6 v+ P: {- C0 ?+ k
        read A_leave from "data.txt" with delimiter "\n"
# `0 s* ^, D7 q& q5 y, Y( S) ^, J        read A_picks from "data.txt" with delimiter "\n"9 A/ X5 n* s% d" r& |
        set load type to A_tote- q( h7 \: M& M  L" I/ C2 |  S
        if A_tote="tote 1" then set A_induct to 1
0 m( u  ]: M5 z9 b        else if A_tote="tote 2" then set A_induct to 2
5 n! Q/ n1 y3 T: T! \            else set A_induct to 3   
5 A$ ^% O) q3 g  J! L. W        set A_i to 0* c& U; Q0 e/ f4 h  d
        clone 1 load to P_induction
; v- V& J& Y9 M# ~" G( O+ W+ z        wait for A_time sec
2 P) Q6 l5 m( K/ d( q    end
- M. J$ [2 k- g! @& ^end
5 h+ j% I6 c4 Y; H
5 t$ O( T1 W  G" nbegin P_induction arriving
, B4 D- A+ R& o. ^" N, ^, ~/ t    if A_induct=1 then clone 1 load to P_pick1
( Y+ a# W+ i7 ?3 O    else if A_induct=2 then clone 1 load to P_pick2% H5 B; D8 _" H/ q2 m3 v9 O; _
        else clone 1 load to P_pick36 O% o; O! o  J4 x% a7 I
end, P# e9 }4 s, A8 F5 }  d
* v5 [3 A' Y7 \. ^7 j3 z2 Z
begin P_pick1 arriving3 \2 L# h, p% {% d3 N, D" v6 r; b
    set A_i to 1
  k! v) `1 k: o( E: ?" e    move into Q_induct14 M3 H4 G4 U) S; i. a! |
    move into pickaisle.induct1; \# K# O! `6 ^" W& M0 e4 l. J
    while A_i<=30 do begin
7 Q) y0 u* J& F! Y% |( J$ O9 k        travel to pickaisle.con(A_i)
; B5 Q5 o( a7 v* i: t) ?& O1 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: g7 s  t' q0 |3 z' L" m        else wait for 10 sec! Y6 N. e4 \" P" N1 T! a
        if A_i=A_leave then send to die6 |! C- a8 i. f: s) u: }' G
        else inc A_i by 1
& S% C8 {) J' ^! r+ H' `    end
. Y: Q' s: ?1 fend$ V# n" U' j! T! b6 H" a
# q, S5 q0 \) E  {6 R$ ~
begin P_pick2 arriving
+ s" D0 ]! N  Z+ Q, v    set A_i to 11
; q. p( l8 F% g) f2 l! r% t    move into Q_induct2
, ~5 ]1 ]5 x8 W) I! l) i    move into pickaisle.induct2
( `7 O: f( q  r/ e$ C8 s    while A_i<=30 do begin; O7 {% o, d& h$ }3 K4 U9 P
        travel to pickaisle.con(A_i)2 |9 V) J& L$ D! ?/ H( ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X& @+ \/ k$ m( |5 ~& H& @" n8 d
        else wait for 10 sec
& p) O! O3 |: w  L6 f! G        if A_i=A_leave then send to die' r/ o" @% M' r, r
        else inc A_i by 1. L; M& S& ~4 q: d
    end' t0 ~- N/ R3 z
end
) w" \$ S( l& |1 P. j, M
# o5 I# B5 S* k! Q- }9 ~begin P_pick3 arriving
$ ?$ u  _. B! b7 v5 K! ~% f4 s    set A_i to 21$ t9 v2 Q7 U: p- p. i
    move into Q_induct3
7 Y6 N2 s, T' `9 E5 Z- |    move into pickaisle.induct3$ X: y; \. E! l- F! C
    while A_i<=30 do begin& h5 ^* R. q9 q7 `' n7 g% o% r" Y% o
        travel to pickaisle.con(A_i). l* o, _: v3 F' C! r& w; ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: M& D' P1 T" b9 g, C) C! L        else wait for 10 sec8 k) H/ T& I$ ~7 E: \% I
        if A_i=A_leave then send to die
3 [2 S5 D) |/ s) d9 o. e( z: Q+ L        else inc A_i by 1
, h. f; h; v7 k    end) K, b) `8 X8 }
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是个什么东东?. G# e& w+ |2 I* E) H$ d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" N* F) D9 t7 O5 ^$ {% C& q6 a

& k' @$ c2 f7 k! R! [AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& Y" ^0 y# b" Y% V
/ `* o6 E2 q6 h  J  C" J% X! p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" D! p* {( a3 z8 \. a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 x3 n8 c; a2 e  E& b2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ k- w& D. L! _$ h& i, y3 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, \5 B) o* D7 o( u! n. hbegin P_induction arriving
0 c: P4 V. O7 _9 Q4 I" Y    clone 1 load to P_pick(A_induct)' R& `" U) ?' S5 ]
end最大的系& L- m9 Z5 r4 i" A( t- {2 j# O4 m
3 Q7 X( \' D5 W- ]: f* w; S
begin P_pick arriving( w3 Y5 p2 h) v/ f* a
    set A_i to procindex * 10 + 10 S: @; F1 p0 X8 j
    move into Q_induct(procindex)
( q  ]8 Q/ l- _# t# r    move into pickaisle.induct(procindex)
4 o( q4 A) I' P8 ^; _    /*check the type of pickaisle.induct(i), for your last problem.*/4 G  G( Y" \! l
& ^$ e# r6 p7 }! {
    while A_i<=30 do begin- e& V3 [$ k' O4 v" F
        travel to pickaisle.con(A_i). W0 _/ f8 ?& N3 v6 ^5 \4 I; l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 L" t; m- z& K( Y7 ?% y8 J! b4 G
        else wait for 10 sec5 Y- r" t6 p1 F! d, q: k
        if A_i=A_leave then send to die
( e$ S7 E6 h8 C+ ~        else inc A_i by 1! r, ?! i5 L, N
    end5 Z. l+ _6 [$ Q* k6 `- h) M
end
1 e, Q: ^" S% W* ^. k* h& P* q& G! w' \- s; D1 x4 B% m
其中的procindex为整形,代表当前process的序号。& f. J# r% F! N& p+ V7 Q! e, p
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-26 23:39 , Processed in 0.015440 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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