设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9910|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' ?3 r% B9 u$ T2 D- k
( [/ d' r3 o* J. B# N( |; q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ n. r: J  S) `  `
0 S7 z! y+ w2 P2 S' c% Sbegin P_read arriving( u/ ~9 }9 `) h. J) e
    while 1=1 do begin, h3 I5 y9 y1 C& V. X: g3 W2 [
        read A_tote from "data.txt" with delimiter "\n"
( @. \5 e1 ]7 a7 R% `        read A_time from "data.txt" with delimiter "\n"
, O% A+ ?7 i  R        read A_leave from "data.txt" with delimiter "\n": y" ^7 H& U5 _6 U, s
        read A_picks from "data.txt" with delimiter "\n"9 G/ v& X' }7 Z6 T) @, f3 G2 \
        set load type to A_tote
- `8 P) h$ N3 T* p        if A_tote="tote 1" then set A_induct to 1' L' Z5 F, Z$ A1 n: R
        else if A_tote="tote 2" then set A_induct to 2  t& y8 I& V$ B1 Y- u) v* Y
            else set A_induct to 3   
3 q5 h) O! E; f( x/ ?, i& b        set A_i to 04 U6 P# w3 ]# R0 K8 F
        clone 1 load to P_induction& T- w/ I1 q, ^/ [  U2 m5 s
        wait for A_time sec$ e9 j6 F4 [2 L
    end/ }7 n8 f+ }. T4 j
end
; d: a/ h8 o5 E: i' x8 y5 t6 o) B' E6 w5 `
begin P_induction arriving1 j' }, X$ e! `8 Z  R" U
    if A_induct=1 then clone 1 load to P_pick19 |, V! }0 C, O+ d! X" C  k
    else if A_induct=2 then clone 1 load to P_pick2) r3 ^( c1 v+ y' q6 G
        else clone 1 load to P_pick3) J4 n3 ~9 p, a: a+ M* i! K
end
# y4 r7 Y7 F% i/ p9 }* t4 Y$ O% U$ j4 j* Q
begin P_pick1 arriving# U$ c- V% B1 N1 ]% @5 `
    set A_i to 1
/ A5 ~& g) Y, [! x# d9 P( s    move into Q_induct1
: r1 C0 h; c/ D0 s7 V, H    move into pickaisle.induct1
" |* o8 H- J9 V  T9 M    while A_i<=30 do begin% z& g) s! O8 J, J% x
        travel to pickaisle.con(A_i)/ v4 A5 H" ?- a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 r  _1 m) u& F+ W6 {, ^
        else wait for 10 sec
* W( C: c! {) K9 I4 q$ k+ m4 j        if A_i=A_leave then send to die
6 F) |9 B6 m4 z1 ~        else inc A_i by 1
3 V; V/ s, ^: |& G+ P    end# t/ G+ |8 \( ~' o0 @
end, N% m4 X- D+ E! }+ e1 M' x

. P$ a4 d- J, @* o3 k# q( a, rbegin P_pick2 arriving) }0 m9 e# p! }+ T) x# }* u
    set A_i to 11- ]7 ~% _+ D2 H
    move into Q_induct2
+ K/ F7 r, q; d! S9 y: j; O$ z    move into pickaisle.induct2
6 c- E8 l6 S) T3 V1 W& Y# h    while A_i<=30 do begin/ r- U. B$ V# K8 ^* [: x
        travel to pickaisle.con(A_i)# z9 h! M7 P4 N+ p  ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* q3 P3 C+ z' {* {( {, V' H+ `
        else wait for 10 sec
4 ?: H6 e! v. A6 v8 S( \        if A_i=A_leave then send to die
9 @' Z. ~* \% w2 I        else inc A_i by 1
7 {0 S7 A9 |2 F; Z6 M    end
2 W9 Q! ]( ?# L7 cend
- U9 i* }, S% x& m' l& V0 L- a7 X1 ^( w2 a3 U( y  v( s) b
begin P_pick3 arriving
; m+ h! k2 n0 z1 t. {9 |. r' k# f, @    set A_i to 214 r. u. r& C2 i+ z1 B% k
    move into Q_induct33 w: _: Z8 m" R9 u
    move into pickaisle.induct31 ~* x) P! q& x' t' y3 ^3 ?- o
    while A_i<=30 do begin
- C# U* L4 _" g6 H% ~        travel to pickaisle.con(A_i)
# `0 `0 B# w" J. b) H" b& s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 S" N7 s" r' X" [7 g6 A
        else wait for 10 sec% @+ b0 m2 _* T3 w
        if A_i=A_leave then send to die
! f5 Z" Y8 Q$ f, ~# F' }        else inc A_i by 1
" f5 X8 q5 C4 b/ k$ R! d    end
( I9 ^' q# ?, ]# B) Bend

最佳答案

查看完整内容

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是个什么东东?" W3 `6 \5 M7 M- t' Q' n0 N# g  O
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' f! I) V% \# z( \+ s
0 ]7 v1 W4 x5 j) K# w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ C4 Z, g3 j( h4 c0 ]  y
$ `. ^: f5 p4 q) n7 {* `. {: J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  {) d# a3 h1 `9 Y8 ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 T) [, b# R3 l4 }' V! B0 r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 c/ s. c( i) ]3 v" D* k& s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% e9 F- f- ?# D' ^* E7 Obegin P_induction arriving
1 c* ]! G# f" O4 V7 B6 W    clone 1 load to P_pick(A_induct)% n$ f, l; ~6 C2 V0 p
end最大的系; F; l6 A. V  i  ?  [) l) A; V' E" c

* c: q9 Q$ `1 ^  ~" G/ T8 k  qbegin P_pick arriving
, s( W- r9 i, M* K* L    set A_i to procindex * 10 + 1# G8 ~  j6 G; f1 |; b+ ]
    move into Q_induct(procindex)" {$ `( R& P/ i% x) {
    move into pickaisle.induct(procindex)* c; E+ v. F7 W* p5 j* g
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 ^+ q0 ~# I8 R' }2 P9 ?" x7 O! a6 |6 H" \  f" m$ g% s
    while A_i<=30 do begin
+ b! r6 j4 I) N+ f' l% ~        travel to pickaisle.con(A_i); t, E: R: F( k/ v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" g* k/ V% N' E5 K6 ^- L  p
        else wait for 10 sec
% F3 U+ D1 G  M) B- O8 W/ X        if A_i=A_leave then send to die) V- e% j; m" A& m3 [8 [
        else inc A_i by 1. E& G1 [7 D3 ~
    end
1 H4 l# O- l* k+ f; dend
1 W9 X. M' u) @+ r9 \# J' `0 H* j* e1 b  ^0 R
其中的procindex为整形,代表当前process的序号。8 w6 e+ q* |- |9 H$ ~
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, 2025-7-16 10:27 , Processed in 0.015814 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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