设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12109|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 q% H5 e2 M( ^9 i
6 X) d5 k; P' r1 n  Z  A+ h. K
我的问题是,在每个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 F+ C9 J, u9 t# Y
& F2 r) f. Z8 d" _. E5 ebegin P_read arriving0 u( \/ J3 F6 U5 L
    while 1=1 do begin) B7 a% @8 A9 F, o! w6 ^& U0 S
        read A_tote from "data.txt" with delimiter "\n"
3 K4 }  E* V- ?: @! p        read A_time from "data.txt" with delimiter "\n"
, {% N, f6 u, }: i% W5 x( [4 o        read A_leave from "data.txt" with delimiter "\n"
& W: a5 }! [8 E" D0 e2 f, r        read A_picks from "data.txt" with delimiter "\n"# U7 R) P/ S3 [% q- B. T% _- q# R0 g0 |5 n
        set load type to A_tote8 H$ Y& W) a% M$ R$ c; J
        if A_tote="tote 1" then set A_induct to 1# }9 D" Q2 U, I0 F4 I0 H: q
        else if A_tote="tote 2" then set A_induct to 24 o: J9 r6 X- a4 ?$ N2 y
            else set A_induct to 3   
3 N* f! O# c* f) U% F+ G" T) v        set A_i to 07 q/ v$ Z1 k, _& _
        clone 1 load to P_induction4 b; Z, l+ b# E  \
        wait for A_time sec# U0 v( j6 k" j1 p8 Y. [% S0 M( j
    end3 `7 U( u1 s4 c+ I7 u# P
end
# s! N5 Q4 w7 c* l1 \8 D4 v* O% l: n8 d% f* a6 Z9 U/ v, `2 }
begin P_induction arriving
) c. f# f$ d2 ^6 v* ^    if A_induct=1 then clone 1 load to P_pick1+ l8 l2 u  P. q( b6 {
    else if A_induct=2 then clone 1 load to P_pick27 F0 i+ Q3 C: G( j: @
        else clone 1 load to P_pick3
: @# I/ t  z0 Eend
& k7 E* k3 |, E0 C% D) `' \" c- T  Y6 }7 V6 K
begin P_pick1 arriving
+ O- y7 S  E. e- |" N    set A_i to 19 t# w/ [% X% R
    move into Q_induct1$ P! O  Q7 S& H; }- p: o. o
    move into pickaisle.induct1
1 s( E/ H8 R, z+ E5 ?; U3 x: p    while A_i<=30 do begin( r* y3 [" {1 H9 q9 b; N
        travel to pickaisle.con(A_i)4 J& Q  o1 }! @6 i/ m. X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 O4 i3 n) f1 B7 b
        else wait for 10 sec
( M; T. Z# p9 R. Y5 I        if A_i=A_leave then send to die; y, v; P$ S0 t9 p& j8 X  [
        else inc A_i by 1' n7 k4 A( h0 I' \* \: T
    end% P3 R* B: P$ p" \# S
end
8 y4 E& L1 s) Z# {$ R2 X) c9 s: W2 N8 D/ H1 c
begin P_pick2 arriving( f* h+ e: n' ?( J
    set A_i to 11& Y* v; U1 a+ b0 R5 ^$ m
    move into Q_induct2
$ Q0 q% I7 S& T4 \9 y    move into pickaisle.induct29 A3 p) \9 _. m
    while A_i<=30 do begin
; h' k! `- f( }+ Y7 h        travel to pickaisle.con(A_i)
6 P$ A4 ?2 n) A2 e. s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  a% V0 B% j) N/ @' N2 q! v        else wait for 10 sec
/ ]! O6 r* r" |8 ]        if A_i=A_leave then send to die
  N6 O* u) g' A( c  e0 M2 `' g- Y        else inc A_i by 1: b) v0 ?+ ?$ K9 ?8 Y6 x
    end
. f6 q- D4 A+ H' {& eend) d* u5 k0 j! h$ v

/ R6 p; D0 ?7 E3 f7 G4 b) a; qbegin P_pick3 arriving
" x# b& ^: e) r    set A_i to 21
$ a% X5 F. H. ]    move into Q_induct3
* B5 L6 q3 g+ q" q5 j    move into pickaisle.induct3
) V0 ~7 T+ b7 M3 c' K' g9 B2 V# O    while A_i<=30 do begin
" p3 S# _. A1 a' q# P4 c' U2 m* E# n) ]        travel to pickaisle.con(A_i)
% f' _5 x- a. [: e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' b: }2 w8 u0 c
        else wait for 10 sec
. j) L! Q3 d2 c        if A_i=A_leave then send to die
, p4 P) m7 o' Y; J! ]+ D; g        else inc A_i by 1
; z- V0 P5 G* C$ x8 p+ t) J    end
6 G; \9 ^6 i+ V& e2 j% Uend

最佳答案

查看完整内容

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是个什么东东?+ r3 \4 s' R0 \) w+ p: @* T5 \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' s% ~  w& G) m0 a6 o9 x; k; r7 t( O3 g5 A3 Y! q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, ^% N% k, k( C& R8 M( E" _

5 x" A3 x# V- S8 |' m6 P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, M2 w% {6 i* o
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- y$ r* j2 r! h8 q6 @+ h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 ]% N! M1 f$ N% K% {# J, F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' u8 }& W, E! e! H$ E/ m
begin P_induction arriving
8 i: p+ m" O& B& R    clone 1 load to P_pick(A_induct)% z: V' R; x; s) D0 d
end最大的系
! _* ^  y" t; l% G$ p* P
( r/ P2 P8 h7 Abegin P_pick arriving
5 o9 M: z5 _1 R( t2 X# z1 |    set A_i to procindex * 10 + 11 w; ]3 q5 a3 T$ [0 h. M
    move into Q_induct(procindex). \! o: E0 |* ]! i4 i" U% A
    move into pickaisle.induct(procindex)
8 Y2 E; s2 U; c6 g# k    /*check the type of pickaisle.induct(i), for your last problem.*/& q. D* t+ [: {  x8 w6 L) V, x+ ]
( d0 a2 B/ D' ^3 V
    while A_i<=30 do begin
+ @! s8 b! y* v: y3 m+ j        travel to pickaisle.con(A_i)$ j9 l0 d8 A& Z( d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" J) C' R& z8 J' h& d# r
        else wait for 10 sec7 Z6 |. f2 x. W% O# s/ G
        if A_i=A_leave then send to die+ A- D- s; R' H9 F4 a$ i
        else inc A_i by 1
0 A" r7 j! s2 K0 W    end
% [, \: r: g' r4 j3 |end
& Q2 y5 W* h+ f# p( X& f$ Y! g: J  X
其中的procindex为整形,代表当前process的序号。% h8 n5 f; V" o  U* Z; \
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, 2025-12-28 17:11 , Processed in 0.017012 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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