设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15209|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 Y% \3 T3 x! J8 ]" d) o; f1 q& U4 v4 n' z* r( K$ 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中的数值,不知道会不会有什么不妥。) x& d1 B2 b: ~! C

: j3 X8 p: R2 c  Sbegin P_read arriving
2 L2 l5 {: `8 l1 E  Y6 }    while 1=1 do begin
9 G9 D# @  ?, D: }  j        read A_tote from "data.txt" with delimiter "\n"
, [2 D; F2 W* G        read A_time from "data.txt" with delimiter "\n"# T5 O2 e5 F' D
        read A_leave from "data.txt" with delimiter "\n"
7 I8 s; p. t1 p7 n  p! O& r" E( {  N        read A_picks from "data.txt" with delimiter "\n"4 g5 m0 f; ?) f) P& t+ @+ e
        set load type to A_tote
8 t  O; q( r0 t" l  h        if A_tote="tote 1" then set A_induct to 1. T1 k1 G& H2 {' W& l( t
        else if A_tote="tote 2" then set A_induct to 2
0 H, c& P( a5 x/ t3 ]$ J- @            else set A_induct to 3   
2 n3 p% U+ p* D1 Q2 j        set A_i to 05 D6 I; i$ ^# `: e( H
        clone 1 load to P_induction' v; C! P8 q$ Z  M6 v
        wait for A_time sec
  c: l8 ^$ v6 u* B    end
" L& Q1 _$ b; L  l& Bend
4 C% {* r' |% h# ~
% i: @1 f1 R* j  O5 H/ _6 x" vbegin P_induction arriving9 h9 Y8 u/ q, R, d1 u8 x& T
    if A_induct=1 then clone 1 load to P_pick1
! k9 q( G% _. w. K- b* M    else if A_induct=2 then clone 1 load to P_pick2* G$ T7 ~6 C7 |: s- F1 b
        else clone 1 load to P_pick3
; ]8 T. C6 z" Q$ q0 [end
' X4 f* z# _) \. r
. `4 c0 {: u$ q$ q$ vbegin P_pick1 arriving
2 r& r' x6 D$ d6 |8 V- x    set A_i to 1" w4 x7 l5 d: {1 y* `  _
    move into Q_induct1+ T0 h. \8 b8 Y1 A; V, U
    move into pickaisle.induct1" k; w( B9 i0 u6 r+ N9 b
    while A_i<=30 do begin
6 ]8 \3 V5 @+ S( V+ ^. r6 Y6 F% l        travel to pickaisle.con(A_i)2 _  Z; {# M9 `4 M; }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~, D; _6 L' D' N4 U
        else wait for 10 sec/ L. ~3 u) u) }- s, L" d
        if A_i=A_leave then send to die% w. o! }! Z; U: O2 B: r7 R, P
        else inc A_i by 1: Q/ P/ \0 P6 ^9 a1 ?( q
    end0 C& |+ b: M+ n  [2 [
end0 [, i5 a4 t6 N
7 N" i6 I7 L# h4 B$ Q8 v
begin P_pick2 arriving
$ O/ z$ t' P2 }    set A_i to 11" z* V( b% s$ \, h8 R% `
    move into Q_induct21 j! k) G$ {6 N# G& T* O: [
    move into pickaisle.induct2" h- [8 B/ x8 p: d3 d% R3 j
    while A_i<=30 do begin' o$ I6 E0 N  Q) U5 j
        travel to pickaisle.con(A_i)
/ N( i. `. q0 ]- Y/ i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( X  B) P! P8 N; U- ?$ I7 G        else wait for 10 sec$ r) ?- A% W1 x7 O
        if A_i=A_leave then send to die
3 ]2 e& \6 x% C: G        else inc A_i by 1  R; z# l! X! |4 j
    end
. i' v  _" L; y0 N) L& Mend& r4 q- E( L4 m: }1 Q
* [0 ^$ k7 U3 ?  D' I
begin P_pick3 arriving6 ~/ }1 M0 |% _) d
    set A_i to 21
% S  h9 s9 A8 M4 _2 F0 Q5 W    move into Q_induct3- V0 o# Q) h) B# s- `3 d, M7 z6 \
    move into pickaisle.induct3; l) x1 ~8 h% S( n
    while A_i<=30 do begin" t1 K/ d; ^- [" ^, d
        travel to pickaisle.con(A_i)$ u8 B) \/ Y; g% w# Q$ X, Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S) Y; D- s- b3 W: w3 N
        else wait for 10 sec
5 l& h% V$ U1 I% p; _1 j        if A_i=A_leave then send to die% E) R/ y# j) \( k% ^
        else inc A_i by 1
5 `: G  D9 f- M6 o$ f    end; a& z, ?( n; m7 g
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是个什么东东?
: u4 F3 _/ m' H% F4 Y5 [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ i0 ?2 R- P& A5 j0 }2 G. @; U. n9 A7 |% A+ _9 j9 b0 y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- ]0 \& z7 ]8 U- v
( M; [+ [1 d! A* |& S% d+ g, r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ }( {/ |6 R' |1 P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- A( r- ?+ |/ L! `& D( n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 N: F$ D6 \  c5 f# p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, V( V. C/ B. r3 g8 U
begin P_induction arriving
) Q  F4 Y# I7 B3 b; V7 ]% n% [    clone 1 load to P_pick(A_induct)( I0 G1 E* q* h# E2 M
end最大的系
3 _3 _* ]( p  {/ }' b. i" C0 T7 v+ M7 |2 P0 S" T
begin P_pick arriving
3 o0 T- w6 p( V0 R- k    set A_i to procindex * 10 + 11 F; g6 F: E* o0 }: h, F, z1 N
    move into Q_induct(procindex)
  L8 G2 Y" W2 `1 j4 L! A3 B    move into pickaisle.induct(procindex)  I) ]6 n+ M" X7 C# k; K
    /*check the type of pickaisle.induct(i), for your last problem.*/, ?- M# V. Q5 Q; P) |
* L9 P1 [. l+ v7 n4 j
    while A_i<=30 do begin
$ x! s9 ~/ X9 _7 i/ d/ j        travel to pickaisle.con(A_i)
; R9 ^2 x! @% ^( z$ j1 S! l- r7 l$ F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 {) V  L9 j% P& x        else wait for 10 sec
$ M4 _+ w/ P# L% c; w# X( J, a        if A_i=A_leave then send to die
. _8 V" z1 n. h3 z* N        else inc A_i by 1$ x0 B+ s. h& C5 \. g; J
    end
3 o/ |' n( y1 N' m+ J7 H: Lend3 B. g0 O2 Z1 S  M8 q) G' S

- D+ n: c6 G7 e: [# T其中的procindex为整形,代表当前process的序号。
! a$ z- i3 z  p, V' R8 Sstation和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-8-24 01:08 , Processed in 0.021568 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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