设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13273|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 N0 {: K) V3 J% X
/ I' E- g: h3 ^1 W$ U我的问题是,在每个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中的数值,不知道会不会有什么不妥。. r! v7 E1 Q" Y. G( G1 E

; D- r/ w  ^- i3 A' @begin P_read arriving' W& k7 \, a' r. v
    while 1=1 do begin
, i+ ?6 S* x6 u. x6 F9 r        read A_tote from "data.txt" with delimiter "\n"
3 d1 c) z! ^& ?/ V9 L; }% m0 f        read A_time from "data.txt" with delimiter "\n", u  `2 L; L% }# N+ O
        read A_leave from "data.txt" with delimiter "\n". @& |- @3 a# ]% g
        read A_picks from "data.txt" with delimiter "\n"
- b  {7 j$ l0 G/ g, c        set load type to A_tote
4 a0 |" z& n( ~' I7 ^        if A_tote="tote 1" then set A_induct to 1
, j. }0 m% o0 E2 a        else if A_tote="tote 2" then set A_induct to 2: e* G" Y- E% t; [% E" H2 K# ~
            else set A_induct to 3   
) _+ j& i+ j4 g  @; y7 n- M& q( x        set A_i to 07 |( T' q8 o1 Y8 A: @3 C
        clone 1 load to P_induction
/ ^$ _4 d+ K8 R1 Z/ O& ?% L        wait for A_time sec
* j3 e0 w7 m3 w; d# c* @! ?    end* L6 O! ~& u" l; J* {
end
4 r( C! V1 E/ Y* e7 @% J( Y: S
" o" u& e! B* x. U- [" H1 Q; i+ X+ hbegin P_induction arriving3 i6 {7 A' ]; h
    if A_induct=1 then clone 1 load to P_pick1
2 T" y+ H9 p; A  r( W9 Q    else if A_induct=2 then clone 1 load to P_pick2' x  S6 I$ P: _+ t" q! J9 k7 L
        else clone 1 load to P_pick3
" [. `6 G& l& l8 M- \. I9 fend" s1 m: p- k, I( B2 ?9 U
3 q& J# T$ ]2 K
begin P_pick1 arriving
# x( \, Q" m' n; m1 e7 W0 l    set A_i to 1$ J" a9 j5 D# }5 J) o! f" y: O3 {
    move into Q_induct1
; i" m4 ]% ^1 b5 v/ p5 f4 p    move into pickaisle.induct10 R& n% C$ ^$ f$ ~
    while A_i<=30 do begin
( J/ H9 A5 x$ g& t1 A4 f        travel to pickaisle.con(A_i): _5 P" _6 N+ _7 f/ R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c/ g# W+ x3 \
        else wait for 10 sec# p* o. o. d2 J1 J
        if A_i=A_leave then send to die
9 `6 Q  S8 D+ ~        else inc A_i by 1
* W0 T, L4 G. R9 L    end( T* a& \% Z; U( x# H
end: m' ?. M* v% h% u

. x9 l* q6 j1 mbegin P_pick2 arriving$ [+ J4 I* S/ z
    set A_i to 11
( J2 c# z% z2 s    move into Q_induct27 k' D: w: ]# K. o! [$ ]" q. p* h
    move into pickaisle.induct2
# i% |2 a! d5 E9 [+ R& C3 x4 G4 r    while A_i<=30 do begin; P- E) O* d( H0 m
        travel to pickaisle.con(A_i); W: H  Y. b+ I5 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ E* }. ?8 B3 V1 x        else wait for 10 sec
4 F  j/ w* E2 x4 @/ _  k: H        if A_i=A_leave then send to die( E; k& z* |' b! J0 b* \: A
        else inc A_i by 1
; e! ~' n/ v8 y  m    end+ T4 b. w9 u2 Y/ {5 r: [
end
/ t. U; W/ N0 Y+ Z+ ^5 T# y8 y+ e+ R3 J
/ q, f8 m. X8 l0 _7 Y7 obegin P_pick3 arriving
- q; i0 S8 e1 l. S: h" C. ]    set A_i to 21
. {! T. d4 V: Y" B- U; F3 N. }5 T    move into Q_induct3
# P1 p* ^: [& P; ]% l& p( w9 @    move into pickaisle.induct3( |% s* |1 z' g! w. t
    while A_i<=30 do begin
* N$ m; w! O& i, j        travel to pickaisle.con(A_i)1 _: z. Q0 U2 d5 t) b4 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S# ^$ B+ e/ j& o1 G        else wait for 10 sec
9 @& P; L7 v" Z( D- v- g/ l  v        if A_i=A_leave then send to die
8 Z5 f+ s  j. o% c4 u4 R* N; _: u( Y& `+ Q        else inc A_i by 1) x* }8 ^9 ?) N0 K8 V/ J" W
    end
6 ?0 J# X- T# Vend

最佳答案

查看完整内容

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是个什么东东?
" z0 F; ], T  N; T) {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ A) W) t" ^  x8 m: N1 `( n5 [* g
: @5 ~3 G" {6 X+ K3 b: }/ aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' d. `6 S5 s+ ~, a% e. Z

  \" w2 u; A4 b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" `7 W) \7 S! ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; \2 u% r; y; e$ R  Y( N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" p& `% e: q6 h# F) p+ y! p0 @% E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; k7 x% c8 ]7 @; a4 i/ zbegin P_induction arriving
! e2 ^2 l; ^" a. G    clone 1 load to P_pick(A_induct)" i. D$ w" _( j$ B4 u3 e1 w* `
end最大的系
# N: q3 Z0 `: ]' P# h) N$ N( m! `, x, ~/ P3 [4 H. V6 M9 }
begin P_pick arriving
8 M# j( L6 H4 t6 {5 R: |7 j    set A_i to procindex * 10 + 1
* m+ R' ^( ^9 A: K. n    move into Q_induct(procindex)  B2 r  p# K; A8 T3 k8 g* j
    move into pickaisle.induct(procindex)) b! s" G- Y8 K2 u' o1 Z
    /*check the type of pickaisle.induct(i), for your last problem.*/
; A7 E  }# l2 y
$ j0 c* }) B6 e# x    while A_i<=30 do begin
, l+ U3 `; q- f7 r3 {9 t* k        travel to pickaisle.con(A_i)# `" s* X: U& H6 [( \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) c& u+ q" `4 m! j$ u: X' p7 j6 M' X- x
        else wait for 10 sec) g1 Z0 E7 T3 k; a
        if A_i=A_leave then send to die' v8 B& M6 u5 Q% c6 m
        else inc A_i by 1
7 l- G% A- O" A2 [4 }/ t3 g* o    end* t/ t, i" |5 P7 Y
end
3 \0 B1 B) W7 S+ v% j' z( C+ [2 u+ r( [( _+ o5 B6 S$ b
其中的procindex为整形,代表当前process的序号。+ d8 {  e( u6 C$ C
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-3-31 16:41 , Processed in 0.014118 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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