设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12943|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" t7 ~, {. D+ q! s) @
" A7 |, r' @, Z0 Y1 K5 A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 H4 f5 C1 I; n$ b
& ~! }4 c2 M" d. p( |0 S0 abegin P_read arriving
/ e1 N8 F, |7 y) l% F5 ^/ n    while 1=1 do begin
. V5 `' W# x% q/ |  X        read A_tote from "data.txt" with delimiter "\n"
( c- z! i/ o! J" ?4 d. M, C) W8 O; I        read A_time from "data.txt" with delimiter "\n"
+ `# |$ M* ]/ ]2 [        read A_leave from "data.txt" with delimiter "\n"
5 X; z  y1 H  S        read A_picks from "data.txt" with delimiter "\n"
1 d8 i/ Y/ R' @7 V2 m' s        set load type to A_tote, Y& Z3 L6 U2 ]
        if A_tote="tote 1" then set A_induct to 1. [; ?- z1 L# u, \
        else if A_tote="tote 2" then set A_induct to 2& U! i4 Y! `" z, Z9 m6 F
            else set A_induct to 3    7 S: i; u; K# h9 u
        set A_i to 0
* ~  W& U6 d" j# J/ E) T$ f        clone 1 load to P_induction. }6 s3 R& k" {7 r# f
        wait for A_time sec
9 L$ G' c. F, U% U" G    end
9 U7 O( G7 _6 \/ h+ ~end0 s$ G9 }/ s' A) K

$ p- i! X2 u. q! z- F+ D$ a, \begin P_induction arriving
. n+ Y3 U. I3 f( D    if A_induct=1 then clone 1 load to P_pick1
% v  M9 n/ A: b* |6 u7 N, o    else if A_induct=2 then clone 1 load to P_pick2
: P2 I- B! U  O; Z+ t0 @        else clone 1 load to P_pick3
7 Y% L  K+ N& dend
( _( X. D, Z4 j+ i3 z. }. P# ]7 j' T+ `# w; d/ o6 j
begin P_pick1 arriving
4 h+ @0 `7 G. \; D    set A_i to 1
, m2 m' o8 w& i7 B8 w5 e9 s6 R    move into Q_induct1* F" ^# C" d6 |) i
    move into pickaisle.induct1; }0 y5 D1 |6 e  c( H( W( v
    while A_i<=30 do begin& E0 y) a6 c5 R6 j8 M
        travel to pickaisle.con(A_i)
2 a" r$ m" _8 W8 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 s% K* k. I6 M$ I9 J" [        else wait for 10 sec' T& t* S! d5 D; w& I5 _
        if A_i=A_leave then send to die
7 o9 M" a6 [/ U1 H        else inc A_i by 1* A% S4 y2 L4 p8 ]% ^  ]
    end
& F/ R9 {3 z3 ]$ @/ Fend
% |' `. R# p* E& q  t7 {4 l$ ~+ ]4 o2 A6 W
begin P_pick2 arriving
+ C2 G1 \9 q7 C5 N9 h    set A_i to 112 }4 L" l, M/ c7 F
    move into Q_induct21 K, V& g7 o* x3 g) j' r, {
    move into pickaisle.induct2
) s( P# X) P8 K( {7 J/ w* p8 K6 S    while A_i<=30 do begin' h8 V9 k0 |4 z# T. _4 P- O/ s
        travel to pickaisle.con(A_i)" l" Q" g4 z8 R* O3 N$ a. \" C/ Z# ^; I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ^6 f: D2 B; d! T
        else wait for 10 sec
& ^, Y) P' H; `9 o5 l  [8 i8 a        if A_i=A_leave then send to die
3 T% j! U3 }# v2 U        else inc A_i by 1. Z* g& ?0 W5 a0 M& K" i
    end
, q+ {# k0 x7 e# L% Q2 s6 lend. b, p4 `7 L) c: I+ ~8 e- B

8 {% M. i5 w/ I: E% k5 T3 xbegin P_pick3 arriving* W$ C0 y( c" M2 |2 v
    set A_i to 210 G/ t- t: ?1 ^, W8 A
    move into Q_induct3
/ H/ z% ^/ t6 n( c- D    move into pickaisle.induct39 ~( G# B- u. D- l* @; v
    while A_i<=30 do begin
6 w* i, x3 n/ l        travel to pickaisle.con(A_i)
3 C/ @8 P: h3 P: Y! r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c0 D8 g" Y$ J% ]; A        else wait for 10 sec( B. j0 j5 P. Y' H* @: i
        if A_i=A_leave then send to die  }5 s! f0 L( s' g
        else inc A_i by 1
2 V+ }* T" @! E    end9 [6 q8 D6 g( R
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是个什么东东?8 @+ d" a: p8 E% u% a+ r1 |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* ~) D: l* K0 ^% E# y

+ T. A9 v' R* j2 M5 q2 y& I" EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ \$ i7 K0 Y1 e  ?; K8 @! a/ Y. _# b6 C6 `- L! v  c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 N' p- k/ W! K6 q8 N! ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  a; N* \+ O" a: g& [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: _4 h- W; D# b; {8 D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 ^0 {7 R. K; X& Hbegin P_induction arriving- J1 O1 q! T" o% B/ ]
    clone 1 load to P_pick(A_induct)7 I% X8 k, k: B( W: T7 d& }/ y5 F
end最大的系
" k3 x4 z: @  n5 @5 J3 H  t' d. W
begin P_pick arriving) q+ [* P+ y1 X2 n2 @) H* X2 c; U
    set A_i to procindex * 10 + 14 {; f* s; W/ g1 n- P( L
    move into Q_induct(procindex)) \4 i  r0 |5 q
    move into pickaisle.induct(procindex); G5 S! X: Y8 m: X0 c& d3 P$ s
    /*check the type of pickaisle.induct(i), for your last problem.*/1 _  U% d1 L. @4 S& D9 Y
  b- L( _: Q  h! @0 W
    while A_i<=30 do begin5 ^8 B# Y1 {7 Q
        travel to pickaisle.con(A_i)
( V3 y. u. L8 Z; H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 u2 A1 b( u& i+ X7 R) [. R, K
        else wait for 10 sec
1 F% v, p) K: i# q        if A_i=A_leave then send to die
; S; n3 P( c& n  a/ ^        else inc A_i by 1* p0 S* Q$ V1 U. |! X( z
    end
; `3 n$ |! O$ Q; P; p. r$ eend
* C* R( E1 ~9 r' e! R6 S# b7 Z
1 Y5 Z* X' o, e; k' \3 }- ]! Z6 j8 h0 z其中的procindex为整形,代表当前process的序号。
# @6 W. _0 `. [7 Q8 q: o$ Fstation和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-4 12:41 , Processed in 0.015796 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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