设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15419|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 l* @; H' W9 e5 c: J, Y) g$ e2 E8 q( ~; H5 a/ C, E& l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  Y& M3 y- h3 Q

: M8 U" k+ [0 g9 S' R/ }begin P_read arriving" |, Q/ H$ b, `
    while 1=1 do begin
5 K' J) i3 D( Y/ T; K7 z$ X7 I3 z1 [5 y        read A_tote from "data.txt" with delimiter "\n"* r4 @4 P  E9 O1 B( I
        read A_time from "data.txt" with delimiter "\n"5 `' e8 h0 _% e% s
        read A_leave from "data.txt" with delimiter "\n"
0 V$ @" e3 a; w" V# _        read A_picks from "data.txt" with delimiter "\n"
8 d" f" s: _% ^: l8 k, v4 \6 s        set load type to A_tote7 u+ V* e4 o: W: h6 i3 U6 X
        if A_tote="tote 1" then set A_induct to 1$ h; Y8 l4 z4 g) K
        else if A_tote="tote 2" then set A_induct to 2" z4 s0 d8 K4 j. c: t
            else set A_induct to 3   
- G6 N# o- g0 ?8 `3 i! ^/ f        set A_i to 0
' j" \7 s' [6 ~: t: \; D' _: d6 e        clone 1 load to P_induction3 O0 A* T3 O* O5 v1 Y: G) i
        wait for A_time sec- Z1 T9 T3 H: g
    end' y8 H' j1 k* v; z
end
5 c6 R+ v( z6 h: |" ~
, C2 @) r9 `2 I) {7 ~& Dbegin P_induction arriving, j  {0 [  _2 h* A3 w2 Z1 c* v
    if A_induct=1 then clone 1 load to P_pick1& B2 N9 ~( H. `( v% z. |: ]$ ^; i
    else if A_induct=2 then clone 1 load to P_pick2/ K( A0 j2 @6 _6 j/ \$ N
        else clone 1 load to P_pick3
0 C8 ]5 u+ H/ X4 K3 Iend0 O5 d, S9 Y+ X6 H" m7 G$ o
8 U7 y* ^- B8 q$ g
begin P_pick1 arriving
% W2 P% |/ \- V* k3 v+ a    set A_i to 1$ [- l1 A( N. W* N# w
    move into Q_induct1
' H7 T, j8 e2 r6 D* m    move into pickaisle.induct1
. k  X# W8 b! ~. X2 G  d: ^9 Z    while A_i<=30 do begin4 Z7 w! K: i5 H: Y% M8 `4 m
        travel to pickaisle.con(A_i): Z; R5 i4 L' ~  g* p/ B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 m4 D# ?. L( N) J- n        else wait for 10 sec. h" k2 I) `# E8 Q. x
        if A_i=A_leave then send to die
" E' O& r2 b) g: i' f        else inc A_i by 1
' `, G3 }; H  F) I    end
$ e" J) t, J& t% j6 y/ hend
5 n6 n! O5 @4 O# S# u  R3 x! H' S' c, J8 M& ]- s+ m. {9 M
begin P_pick2 arriving3 v; T- A1 [$ U1 |8 \
    set A_i to 11, _. V+ H4 ]1 L/ Z* h; h; K9 f
    move into Q_induct2$ O5 k, \# {! e; M8 R- N( {
    move into pickaisle.induct20 B9 R& V# ?! W. `8 H( I. s: H- m
    while A_i<=30 do begin
" W3 ?( ~! V% l, ?8 @" S$ d( \        travel to pickaisle.con(A_i)
4 N* l* w4 s+ p3 ]; }- O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |/ u( h. }5 V; ^7 Q/ g" i  L1 M) J        else wait for 10 sec
& F- X" Z% E' X0 z+ R  w  [        if A_i=A_leave then send to die
5 T/ N' `) c& e- j: H% ~! F: D. |9 [( G        else inc A_i by 1+ N* ~6 C" ~$ b& |
    end
( U* P" k, f; o- ?1 k! @end9 P* s; M# k$ B. w- M1 U
& a* Z! e, W# Y6 P  w
begin P_pick3 arriving
% ?9 t( j& x* n: W    set A_i to 21
2 M5 j6 P- e8 K& i+ K    move into Q_induct3  J7 n& x7 L: Y
    move into pickaisle.induct3
" o1 |, j# W- V3 I/ |    while A_i<=30 do begin" W, S, a  q: I8 o0 \) k/ G9 r
        travel to pickaisle.con(A_i)8 _4 G4 V' h% ^  S6 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 }4 B2 ?/ P- ~9 ?; I
        else wait for 10 sec. M# M. {1 w: O0 n% N3 v: i
        if A_i=A_leave then send to die
/ G, D3 P8 t& C& B0 j) H2 M' Q        else inc A_i by 1
3 ~1 T- x' x7 S3 u# g4 f    end+ K3 E3 z5 Z) ]$ F, g$ h9 a9 @7 N
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是个什么东东?
3 d3 i1 ], W! Q1 J3 o8 }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ g: m2 M" h3 a9 |5 ?3 z* y- `% |: |$ R
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 J# h; E" o, D7 K! A
; p+ w5 Z$ m  q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# `: U/ T, w/ \1 `; @' q! f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 z/ V% a5 j% p, i1 ?7 b, ?) |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. N9 N$ `! {" D- ?8 j& u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 c# K" _, `% d! w! q2 p8 _2 J" u
begin P_induction arriving
# u% B% Z) A. G6 x& d# p2 q1 k/ C    clone 1 load to P_pick(A_induct)8 q3 L% C9 r* k& \
end最大的系( o& |+ B, P  _9 j1 a5 `+ u& r) Q

9 c. x% I% m* |9 d7 Z; ^) [begin P_pick arriving
+ L' n+ w2 |# V- ]9 l    set A_i to procindex * 10 + 1
9 h) O# [. c; y7 Q. q5 k) I  {7 \! @4 p    move into Q_induct(procindex)
. U4 V' J0 h' W4 e% d8 d    move into pickaisle.induct(procindex)
0 T) s5 a$ N) g    /*check the type of pickaisle.induct(i), for your last problem.*/$ u' H' z0 l' U5 D
4 t4 U& R/ ^/ h1 F1 J8 z
    while A_i<=30 do begin
  H, ?- W& ^% X' n8 B        travel to pickaisle.con(A_i)2 Q2 W' u; M+ d) _" D7 {" J/ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 r2 h, w1 X2 Q  t
        else wait for 10 sec
6 y, O/ y! Z% \! x        if A_i=A_leave then send to die7 g/ C( O, X  e  K, Q( G
        else inc A_i by 1
3 ^/ m: `- j8 }" o    end
- `  e3 [. i9 P8 `5 L0 w. s! R& {end
+ E2 J7 \  N, u: ?) u: T) a4 T' Z( W% P+ l9 f( B& e
其中的procindex为整形,代表当前process的序号。
! _, H. z! C+ G3 X6 _1 cstation和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-9-10 02:52 , Processed in 0.014196 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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