设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14662|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, v  U0 {2 M/ L( a

" z2 X0 N/ B- v0 S我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ m+ h+ j( }- S4 R& I

4 d* y6 ]8 G0 ^2 Q: K& Abegin P_read arriving
, S" Z7 d& V7 G0 w: i2 c- Z    while 1=1 do begin
* {. k. L( B( r$ K$ C' D        read A_tote from "data.txt" with delimiter "\n"
" O* {" t/ z4 S- R3 ]3 [        read A_time from "data.txt" with delimiter "\n"2 g. }/ k9 S2 {- ]& D
        read A_leave from "data.txt" with delimiter "\n"8 E/ Z, U) l. e; l+ F2 i0 r
        read A_picks from "data.txt" with delimiter "\n"
0 ?$ F6 j! `; |5 _        set load type to A_tote
  w$ Y$ L6 ?' C6 [5 [        if A_tote="tote 1" then set A_induct to 1! q* q, @; w1 \( a) P' X
        else if A_tote="tote 2" then set A_induct to 2
9 Q1 G, T* l) u6 V+ G            else set A_induct to 3    ! e0 `5 M5 L" S+ M3 }
        set A_i to 06 C0 _+ U. }6 Y# L. L' Q  G8 z
        clone 1 load to P_induction
  h- i0 n/ T5 i        wait for A_time sec! i* m6 b: F$ d
    end
: A4 p; C$ }, \end2 \. g9 F$ J( B& D' t* {7 ?
' W9 b! n2 K: D( `% [
begin P_induction arriving
8 h$ _. T  [/ q7 \% Q    if A_induct=1 then clone 1 load to P_pick10 v' `" C( h. f" R' E5 \  X
    else if A_induct=2 then clone 1 load to P_pick2
! B; Z' r* _5 O) W5 `; j$ G* k        else clone 1 load to P_pick35 y! C$ I# d! H& V) f- W
end
4 A: f$ L! I8 V7 M3 H- M' @
0 z, k$ M' _/ X0 X8 X1 W% Wbegin P_pick1 arriving7 w0 x. t  S* B6 b
    set A_i to 1
, a4 s2 S1 U, w+ t    move into Q_induct1
, _( S( C9 u/ @% p, ~, S4 j    move into pickaisle.induct1" H# _7 m  }8 y: C' }" A
    while A_i<=30 do begin" [1 [6 R: I! [7 x2 t' @# r$ t# c6 M
        travel to pickaisle.con(A_i)
. T, e. w8 D/ Y, c; t* [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ J% I  S$ Y4 l0 b
        else wait for 10 sec- t# Y( X1 w  Z+ {6 A: U2 a3 ^
        if A_i=A_leave then send to die
, w* W! p* U# U) U* u        else inc A_i by 1
4 A% j5 N0 _7 @3 b    end
5 G* n2 ?" q/ ~  b2 Xend4 z( y: b+ e# i- V; R) d

7 |7 M1 ?  Z* ?* vbegin P_pick2 arriving
& I; Y! [! I" d  A& m; d3 y( z    set A_i to 117 c2 Q) o" P. ^8 i+ M) L
    move into Q_induct29 x8 p3 J2 c  v. }0 m0 v, C6 n
    move into pickaisle.induct2" I$ n9 g7 C0 S
    while A_i<=30 do begin3 t& U9 n2 V! G0 S, e
        travel to pickaisle.con(A_i)6 v& U+ _/ @6 n% r+ z* o/ T" q/ \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 m/ P& G: h/ n4 m* c& X0 R
        else wait for 10 sec" Y0 g3 n8 v8 p* H
        if A_i=A_leave then send to die
. s' D" _2 v9 {4 [' }% ]3 E0 }        else inc A_i by 1
1 G2 e. r2 l; Q    end8 d5 @$ M0 ^- C% L, o) U( P- p
end. M, }+ i& C. e4 h: J$ {! a
# q& k$ D- V5 C' c& V" l
begin P_pick3 arriving, I2 g- g4 `7 J# g5 A" I) [
    set A_i to 214 |. B. J) T; B; K/ d- v) f
    move into Q_induct3
( R" Y3 p$ L* q' |7 h$ J, p    move into pickaisle.induct3) H, \+ x/ y% C' T
    while A_i<=30 do begin6 _# x8 S& e2 l, Q% a: n
        travel to pickaisle.con(A_i)
: d% j( S0 j: w8 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. i6 Q" V8 t) I+ Z        else wait for 10 sec8 g) f6 R0 I( P4 G0 n/ x
        if A_i=A_leave then send to die
# E9 T5 A' s# Q' [3 U9 @+ B9 a        else inc A_i by 1( i( Z8 s" i" B  P
    end
8 q$ I' I4 P* v% s- aend

最佳答案

查看完整内容

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是个什么东东?7 ^! r  e2 n1 H; V, h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 R/ h% E* v& \% l* ^

% P/ L) g* _/ v! gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% G9 n7 D. w1 l$ }% H" E
+ `) o0 t- [. y" o! P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% F; a" |- g! w3 u/ g3 @7 o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 y" W/ @! m. q0 l6 `+ d
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 d& t. @( {6 M) K" ~- Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 [' @- ^# B9 E7 X, {* V8 h
begin P_induction arriving5 \0 C: z" h" V) d3 B2 I
    clone 1 load to P_pick(A_induct)8 X5 N: h# `3 Y9 \% ]3 m
end最大的系8 w; G4 }  ?2 w. l, O

% Z( `2 f  p" n& rbegin P_pick arriving
9 z+ Q. o6 G; b3 V    set A_i to procindex * 10 + 1
1 n/ C! W: T' [, V, Y2 m+ B- A    move into Q_induct(procindex)
7 A. E2 K2 g6 |6 ]    move into pickaisle.induct(procindex)" |- t, z4 h+ b( w" ]
    /*check the type of pickaisle.induct(i), for your last problem.*/
% `2 f% s2 T/ K$ w6 n% l* H8 D+ U$ `. w- w/ r
    while A_i<=30 do begin/ ^, _" s% _0 M% u) ?: q
        travel to pickaisle.con(A_i)7 O% Q. k" V( I! m+ G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" J( ?) [" X' g- H
        else wait for 10 sec; h  l: `1 w2 U$ g' o) [# g1 p
        if A_i=A_leave then send to die
. W! F7 c/ F9 h2 @1 P3 z        else inc A_i by 1* }' l( s' U1 g/ h
    end: S" l' G9 b0 J; q
end
# k. t2 S" `8 r& ?, ?; C! X+ }2 i) v, h& ^
其中的procindex为整形,代表当前process的序号。
) E- e6 H! Z, P: B- S- Istation和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-20 09:16 , Processed in 0.013485 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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