设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14078|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 ?2 R. s+ J; n* X

8 }) q0 ~, U3 y& r我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) v  V! o9 @$ u/ l; [. \$ S) ?% p: k  J  V) J
begin P_read arriving8 h7 k& r# W/ N9 P9 j/ ^
    while 1=1 do begin% i5 |3 y/ w; g. B& d2 v
        read A_tote from "data.txt" with delimiter "\n"0 d7 E# ?. G6 p/ m. q
        read A_time from "data.txt" with delimiter "\n"" z2 @6 y  W& Z1 k. u; J5 i
        read A_leave from "data.txt" with delimiter "\n"" p* E# d) D, h+ X; E: j
        read A_picks from "data.txt" with delimiter "\n"- [: L; P' z* i; I) Q! p6 L6 F
        set load type to A_tote; s4 a1 Z6 {& E( ^0 k5 v0 k
        if A_tote="tote 1" then set A_induct to 1' E. @, F& r. s8 F# w5 P3 ~
        else if A_tote="tote 2" then set A_induct to 2. w5 u) B$ x3 j
            else set A_induct to 3   
  d, L/ S; v( F; e9 k/ [4 y* ]        set A_i to 0
+ h  I. l* `% X        clone 1 load to P_induction- _& W) N: X- ?+ T  u
        wait for A_time sec! K$ R  s' N4 ^1 y
    end9 O9 f" C8 M8 E! K
end2 K* e# I; G: D, d# L# W- ?: J6 X
5 _6 k6 Z: F$ d1 U' Z
begin P_induction arriving
( a& A/ i/ x! `4 }    if A_induct=1 then clone 1 load to P_pick1
/ X2 a: ?: j$ ~+ o    else if A_induct=2 then clone 1 load to P_pick2/ v- j, k5 D$ M6 }, F( r% g
        else clone 1 load to P_pick3% Y2 p: M- o; I5 ^* D5 ~
end
2 v8 K6 O% B) R- `$ B' E
3 L3 q8 n# z7 nbegin P_pick1 arriving) m7 |! g9 e7 X6 D) U! _
    set A_i to 1
2 M) I9 {5 S7 K6 p) ?    move into Q_induct1
0 a4 U# p9 P4 H; I: b, h* F( O5 \    move into pickaisle.induct17 t) X' C  ?9 b8 Z4 Q
    while A_i<=30 do begin
% O6 w2 F! J3 f        travel to pickaisle.con(A_i)& u2 N/ [; ~9 z, j. l" m8 T! c8 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" J5 m' F& R- W' h" g; _( T2 B        else wait for 10 sec
/ g, D% c) R) e( `- c6 K( X: _        if A_i=A_leave then send to die5 D* B- Q3 \/ Q, |; {
        else inc A_i by 1: E, `3 n& q6 Y
    end# ^7 q; R* k5 o- Q
end* M6 X- D  R- U; }) f
1 A& e) P: d) L
begin P_pick2 arriving' x8 K6 Y  Y9 S. {
    set A_i to 11: N, K& r! l, v1 l( }
    move into Q_induct26 |3 E/ l& {: O4 X( N
    move into pickaisle.induct2. ~# y; B7 b" ?$ t; q7 F
    while A_i<=30 do begin) ?# ^6 h) I  q! a, Z) t
        travel to pickaisle.con(A_i)2 v1 ~* W" B- A4 j  R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  {7 b7 B. o4 o* f8 V
        else wait for 10 sec
. `9 n% C9 l0 \. x        if A_i=A_leave then send to die
, F* e( z% n9 l% g8 {        else inc A_i by 1. s3 A" N; d0 }8 _/ j8 @
    end
& F, X+ W1 _, ~- Z7 _1 P* F  p) Zend
% U; |2 _  g( G' p' f0 ~4 v
5 g0 Z4 M% J# V, @8 d. A$ Ybegin P_pick3 arriving
+ M" S9 N# o2 g! p0 `3 X    set A_i to 21. J  f: P. \6 X$ {* Z5 @
    move into Q_induct3
) v$ ~. ?8 Z# i0 `. Z    move into pickaisle.induct3
5 N7 I% x9 l( K8 e- d) y    while A_i<=30 do begin
8 }3 q) ]% ^% K, P3 T" r        travel to pickaisle.con(A_i)6 ]  |0 n# q* l9 X0 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- b3 I4 d* J' M: ^! M1 k
        else wait for 10 sec  W( t" m$ }) U' M: u' Z4 t; Y3 J
        if A_i=A_leave then send to die1 X  S* S1 R! l3 h. n
        else inc A_i by 1
2 }# g6 O' c! B/ E    end
4 X' G/ w! P" p# i# ~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是个什么东东?0 H% M+ L* |2 m( D0 ?( G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: T6 f6 K: V+ l  H6 Q' F' P, _/ o' T+ |; ?# A; ?) w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 \6 Y- \1 q' j6 P" |, Z

" k5 O3 i1 {2 [: h  q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ {7 a, q9 \; L5 l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% [6 f; Q' x- x1 o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) t8 h1 m/ p+ a6 Y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, V* ~/ f  t" i% ubegin P_induction arriving
7 }' x- A, W' I    clone 1 load to P_pick(A_induct)
3 I8 b+ X  e1 G9 `end最大的系
, q" d2 v0 f/ D; B& ?1 C: a6 x$ k- X8 Q2 X
begin P_pick arriving; V* b  R' w, H; i: N) l& G
    set A_i to procindex * 10 + 1
* c" X4 r* E$ @    move into Q_induct(procindex), @( z5 |: Q: r
    move into pickaisle.induct(procindex)
- A/ o2 I/ d( N, Q- `6 v    /*check the type of pickaisle.induct(i), for your last problem.*/& e$ v& B6 N9 a/ s( F
5 A1 `. A5 b- S7 x
    while A_i<=30 do begin/ X8 {' E; C4 J: D& N
        travel to pickaisle.con(A_i). D  M9 _( x$ `. L+ S4 r5 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! x1 N8 j# n3 s5 p& |        else wait for 10 sec" b( Y0 x6 m0 a6 ^) J
        if A_i=A_leave then send to die; H% G# t1 M& g
        else inc A_i by 1: _) A, b* D& X7 Q
    end6 I+ F7 N- X1 B; }% C
end
  Q! D( p7 S4 ^" j
4 [5 e6 g% B3 L' h3 y% N其中的procindex为整形,代表当前process的序号。
4 T, P- o: s5 Vstation和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-6-6 09:50 , Processed in 0.017444 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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