设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14696|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 a3 x+ p8 p; X7 w* t0 U  j2 Y2 Q; n
+ l( l3 l' U# M% ~$ V7 J' 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中的数值,不知道会不会有什么不妥。/ v0 V8 X" }- H* m' K. J' H$ E

% b- c( ~' D+ F2 i1 F! sbegin P_read arriving
( C: h" c; H: r. H3 Z    while 1=1 do begin4 M1 @0 x5 e  ?, B
        read A_tote from "data.txt" with delimiter "\n"+ t7 c6 o7 f+ P' z# p9 T/ k+ t
        read A_time from "data.txt" with delimiter "\n"
6 D3 _  N- D9 \        read A_leave from "data.txt" with delimiter "\n", ^  u' \- a+ N& i, l. \
        read A_picks from "data.txt" with delimiter "\n"1 p2 N6 {8 L8 _1 q( w( y" {
        set load type to A_tote
8 Z- ?) L/ W; O) H        if A_tote="tote 1" then set A_induct to 16 Y# w0 T. i. ~9 S, _0 O0 h
        else if A_tote="tote 2" then set A_induct to 2  C5 z: j' m! f
            else set A_induct to 3   
" ?! L, l& T, d# F% s        set A_i to 0# K5 P- Q9 j6 E2 u2 n) H. {- J& n
        clone 1 load to P_induction3 {8 U2 f! B) ]5 P0 _
        wait for A_time sec3 `& X- ?! l  U. M8 x
    end
5 i' e; p3 e) w3 {- ^0 iend$ A' j  F" w7 c/ k- x* o

, x3 a1 U4 B* f- ]- ]! C" i4 I" Ebegin P_induction arriving- a2 c8 |! p8 Z- y, h
    if A_induct=1 then clone 1 load to P_pick1
( m, Q4 b5 B7 t) l& e5 s    else if A_induct=2 then clone 1 load to P_pick2/ g7 |; c+ E/ ~% B& e
        else clone 1 load to P_pick3
$ q& k. _/ y: k- M" bend
3 Y: O& v' {/ H; L6 B) a/ q- ?8 I8 ~$ ?+ r* g( b
begin P_pick1 arriving  C, [! L' f7 i+ U# `8 [" s
    set A_i to 14 k. }- s2 T: V4 y+ J9 g
    move into Q_induct1
6 _2 P6 a( M) e) ]7 F/ Q    move into pickaisle.induct1
, L0 b4 L  Z. s) }+ D7 _- L2 C7 P    while A_i<=30 do begin" t, t; a; y7 R+ M# c
        travel to pickaisle.con(A_i)
7 G+ Q3 T2 W  I& d* s% Q; ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' X2 C2 `. y- ~0 z0 B
        else wait for 10 sec1 f9 f0 o' D, s5 g
        if A_i=A_leave then send to die
- Z; V  T, X2 R) }7 v: s        else inc A_i by 1
5 M0 m% ^7 d- w6 R) [* J( }2 O! y    end8 y% o3 R( G) z5 W+ j
end) l; n) ~. Y0 n0 b6 A9 |' w1 K

- t2 H' h6 v& [: q# wbegin P_pick2 arriving& |2 ?7 h7 V; E; t
    set A_i to 11, J  p/ c% i7 K5 G
    move into Q_induct2
, S% y" p) k& G6 J! A    move into pickaisle.induct2. v7 t( c0 O  C7 }3 I; y7 Q
    while A_i<=30 do begin
: ?  v* ~; I, W+ }9 M0 h        travel to pickaisle.con(A_i)
5 b/ X4 h# M2 I) ?* ^9 a) h& u. a0 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Z" L# {- a" D: B* H
        else wait for 10 sec
1 L9 X4 H" z$ M" F: i# w        if A_i=A_leave then send to die
6 Q* m7 W! s  F: U2 K* P        else inc A_i by 1- v- L) _6 a# R% s
    end$ R( `$ e- P( {0 w, D
end, [) X; O( \" u" y3 u% |& ^
9 j/ {4 p* _. V9 f, T' r
begin P_pick3 arriving
, f/ q' Z+ F9 K& S& ]    set A_i to 21
6 k* Z5 x% w9 R/ n7 P+ R    move into Q_induct3: o% T' a9 Y4 w( U
    move into pickaisle.induct3
8 k  f# }- N- F5 T4 q    while A_i<=30 do begin# p9 G  M, q' a4 \( w4 A4 H
        travel to pickaisle.con(A_i)
+ x( ?- {. J/ [5 n8 U. B. a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& P" B5 _/ g/ W6 k" d3 I* z) P        else wait for 10 sec
' |: W/ O. d, n2 {0 z! v        if A_i=A_leave then send to die: o4 u2 h' W0 r, h; l  W
        else inc A_i by 1& A5 F4 g1 K$ j9 t* G
    end
4 }" @& c- L! J" m( |6 [3 Z: y/ ?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是个什么东东?( p+ d9 B% k) d* g  ]0 `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 s  q* Z% `4 D
2 [$ `) {$ i4 P2 M3 W! K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 R" F- E: p' o+ E; _8 Q
) p& e0 E+ i+ F" c* z( M3 @: g7 X$ j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% I4 L' v5 S2 d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ Y+ O; T$ n# |+ z8 h% L' g9 `6 M7 h  f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 R7 \7 B* j* a! D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 H( {6 I+ G9 X8 ~7 i  u
begin P_induction arriving) r& l7 Z/ k, w- E  N0 @
    clone 1 load to P_pick(A_induct)
3 C8 g& `# o/ T7 iend最大的系# I5 i5 V! f* ?8 h9 \% g

6 v! X9 x& n9 \- I% p+ F3 gbegin P_pick arriving. X6 J5 }  S$ p" }- L
    set A_i to procindex * 10 + 1% `1 `, `& j4 L; F. F' V' q$ \
    move into Q_induct(procindex)+ G8 S. O+ i- a( m; G6 E
    move into pickaisle.induct(procindex)+ \! O4 s' x% }& j8 S: e1 M5 H
    /*check the type of pickaisle.induct(i), for your last problem.*/
, r2 N; B  }% X; H% P# v9 x* h
* J  X9 C9 D% M$ J( y+ X, P8 u" O    while A_i<=30 do begin
* \  s( _, j( ]        travel to pickaisle.con(A_i)# @% s4 V  n% [3 D9 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" h" A7 j7 b* b
        else wait for 10 sec$ S! g4 D2 W2 u5 x) l1 |# {" [) m
        if A_i=A_leave then send to die
$ l1 i  f: F* Z& M0 J$ a, L& J; Q        else inc A_i by 1
* X. b9 v  `+ Z) A, d, m( B2 L) Q9 A- M    end
! x8 q9 G* d1 n! j5 R* jend
  O/ F4 L% U, Y- @
, S" F+ `: E% d2 [# m& N其中的procindex为整形,代表当前process的序号。
  g- _1 \* u+ V8 Hstation和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-7-21 19:34 , Processed in 0.015309 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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