设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13280|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 t' F6 P% c: k! ~! e
, N4 d: h- Y: _, x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- U* ]4 t% h0 F% D- B4 I$ R
, m; a. B- P6 _. T, K4 P; O( dbegin P_read arriving* k$ A+ l0 ]! B0 C( N
    while 1=1 do begin
3 g; z+ h2 E+ j- L4 l5 S        read A_tote from "data.txt" with delimiter "\n": Z" L3 r' M+ Z9 n) E
        read A_time from "data.txt" with delimiter "\n"" M8 t4 F  g! \# }1 P
        read A_leave from "data.txt" with delimiter "\n"
; a) g9 H5 R0 Q        read A_picks from "data.txt" with delimiter "\n"
6 k1 f* W. U- X) P        set load type to A_tote
' |9 ]* k" q' P% }9 n; G$ \        if A_tote="tote 1" then set A_induct to 1$ I  X9 @: Q! o# z2 ~, q. C" b3 e# X# W
        else if A_tote="tote 2" then set A_induct to 24 }4 C4 Z& m0 K& k
            else set A_induct to 3   
9 f# T' F0 q+ f- W( l# K. Q) Q( J        set A_i to 0
2 j; a; O9 u2 D! S        clone 1 load to P_induction; x  h: J, Y  d  \! p# Q
        wait for A_time sec
9 g% O5 X0 s; w' r, C% y  F    end
1 u  f# I( ^. v! yend
: A. x  u' U+ ]' N3 l5 a% b9 `0 B) K2 N* M, f+ F2 ], t
begin P_induction arriving
0 g+ h6 `* D# L; Y% k8 |* I    if A_induct=1 then clone 1 load to P_pick1
1 T6 J. r$ o3 Y4 w$ P8 K4 V$ y    else if A_induct=2 then clone 1 load to P_pick2
) Z* \; Z! k4 `7 U0 ?: v        else clone 1 load to P_pick3- L1 F2 L1 y6 q. c3 p8 o# l, O
end
) J: c$ d' a3 h* `4 d; j$ d- f! D+ f# @; G; X6 h6 D
begin P_pick1 arriving
: i1 }5 j2 z. n. ?    set A_i to 1
) N/ d/ U  G+ p$ Z  _    move into Q_induct11 Y7 \( h0 j3 V5 {9 v9 C
    move into pickaisle.induct13 N" B1 G2 x' l& r
    while A_i<=30 do begin
& @8 X8 x% e0 s0 P0 F: e        travel to pickaisle.con(A_i)
" p& w, G5 e- q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 v" `+ e+ E$ j2 y
        else wait for 10 sec: m' O+ o9 M3 v. n; V. j. [
        if A_i=A_leave then send to die
- R8 v+ U' }/ Q" E  o; m, r        else inc A_i by 15 ?5 V# Y2 A9 Z( a1 X" R
    end
8 q, T! u% A! W  ^+ k* _end: E$ _+ E, Q0 Y" ^) n" Y' D

( j* h* ]2 q7 J  @0 M/ E% k- [begin P_pick2 arriving0 q( N% n, ?5 Z' n# `) w! v
    set A_i to 11
4 X" J; b& P6 Q3 r4 D/ k8 ?: S/ b    move into Q_induct2: P. l4 H, G5 L7 d* k  @& x1 d+ ^0 H
    move into pickaisle.induct2
* B7 `: x) @4 Y  ^6 d    while A_i<=30 do begin% `. B8 K  E5 z' E* s
        travel to pickaisle.con(A_i)
$ b9 x$ g4 V- [. |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ |8 ~  {% U' Q( L- m7 p3 I        else wait for 10 sec8 V* m) f3 D9 S0 C7 y. S3 O
        if A_i=A_leave then send to die
2 x# ~7 O( H1 j) V. W( i+ H  ]        else inc A_i by 1
7 R9 _2 s' e7 q1 E# a    end$ t* I, W( T! ]5 B5 e5 C
end
& [. `& c# G+ r& h2 @* H- v7 {0 B, l
/ ]% E4 v0 g- Rbegin P_pick3 arriving
5 P3 e& F& ^: Y6 o. U  v    set A_i to 21) Y7 H$ r& O! f5 w% P+ b9 I/ X
    move into Q_induct3& @1 O2 o% `, G* Y; v" _; l
    move into pickaisle.induct3
- P& d2 [, z; G# V" L2 U4 h    while A_i<=30 do begin5 i& V, C% _* {3 x
        travel to pickaisle.con(A_i)6 L5 O) |+ H' S! I+ x2 k& H: \: q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. _  G' f) p, A5 J. [        else wait for 10 sec8 c7 |6 P+ r9 S  x9 f+ x' h
        if A_i=A_leave then send to die
0 g' ~9 B' ]. f# P/ y( f/ a7 z! E; ^        else inc A_i by 1
) K8 V2 s4 d, T! Z- |4 l    end$ T& v" s2 ]( X, f- f4 U& b2 g
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是个什么东东?. M1 G. _4 R; _2 C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; k& }% s% y' s& X6 k4 O1 k9 G) Z9 V" z2 H  `' F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: z/ R0 S: k+ r
/ p% ^% C- g- |, }5 k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 l* S) L8 p3 ~  k1 Z8 Y8 F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- E5 C5 T6 r) X, v0 z+ P, |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: z) Z2 V4 J' m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" O9 {0 t. n. j6 T; Y
begin P_induction arriving
! L  t' H  W+ V    clone 1 load to P_pick(A_induct)
9 X7 l9 t# f4 Oend最大的系- P+ X0 V) l. D; J7 g* R

6 t) F9 t! R, K+ tbegin P_pick arriving- C4 C$ K  f7 |+ ^& X9 u
    set A_i to procindex * 10 + 1
  n9 c% D* l1 C: h    move into Q_induct(procindex)
$ S% u4 _8 `2 q1 s  J    move into pickaisle.induct(procindex)
: ?5 j: N2 R3 W1 d! V* Z$ t    /*check the type of pickaisle.induct(i), for your last problem.*/
- {! `" u) ?2 k: v& s2 T6 y* U, X2 S' K0 ^5 e% L/ f
    while A_i<=30 do begin
0 ?9 a1 \( h8 p        travel to pickaisle.con(A_i)& ~! @6 w3 `7 Z( E1 k5 S6 ?8 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  y1 P' a: B( ], W: q, {
        else wait for 10 sec5 W) l: X8 B2 N2 W/ |
        if A_i=A_leave then send to die) I0 M* K: b+ R
        else inc A_i by 1- ]3 v4 X( `5 [$ @
    end' n+ {$ u* V% O) y# k$ @( B& K
end
/ M  g" [" b3 e8 j! E8 h2 g6 A. R% W% h  Q0 {, H6 j( j8 j4 |6 h
其中的procindex为整形,代表当前process的序号。" [  p7 N* `2 U3 w* @! y" r: k3 s
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-4-1 04:38 , Processed in 0.018410 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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