设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12314|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" m! p7 J+ Z7 u
6 ]/ i8 b# E; A4 n4 `! C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 h9 k$ x. }/ G; [  j3 o+ D
/ g* M3 N9 Z4 v2 jbegin P_read arriving
+ F2 |9 M% M4 B; n/ e    while 1=1 do begin3 N4 i4 G, g' T5 d! z- g
        read A_tote from "data.txt" with delimiter "\n"7 H8 k4 V0 d% i/ b
        read A_time from "data.txt" with delimiter "\n"
9 B8 }$ l: S! a, ]  v% P        read A_leave from "data.txt" with delimiter "\n"
4 a& R$ t* _  y7 ~3 a        read A_picks from "data.txt" with delimiter "\n"0 ]1 U. p/ ]0 \3 g1 x7 T! z" i
        set load type to A_tote
* g1 w5 W( {8 w" K$ D& N$ l        if A_tote="tote 1" then set A_induct to 1
" I) N' Y/ H7 m! A        else if A_tote="tote 2" then set A_induct to 2$ ~6 k7 G' E" _( `4 L* k
            else set A_induct to 3    0 D1 l# B! B1 j6 P# t4 G, f
        set A_i to 0: H6 p! S7 ~) g4 I& F9 ?) d2 Y
        clone 1 load to P_induction
% b+ }9 r0 Q5 @7 }9 D8 g8 p        wait for A_time sec; o! H- B: r  {3 a& e$ f7 s
    end7 B9 d( }: j0 Y; a( Z# I$ t
end
4 w0 v7 q3 z6 K* q
- r2 P4 G9 P# K& l/ L; i  H# Obegin P_induction arriving0 ]  |- p. w- S7 x8 l' v1 B
    if A_induct=1 then clone 1 load to P_pick1' F8 K3 U0 V7 L
    else if A_induct=2 then clone 1 load to P_pick2/ u) v3 j( `2 G& \1 z$ j" R& ~, \
        else clone 1 load to P_pick3; ]! t6 k9 R! }1 Z9 S$ X6 m; ?
end2 M4 W" W) w( T5 j. G7 ]
- }# `* P6 \, H. w8 Q9 ^4 g/ [
begin P_pick1 arriving
0 p8 @) g" B' V! |    set A_i to 1
$ X" ~8 t" j4 o/ O7 g+ X! e& L: ^    move into Q_induct1
. g/ G$ w9 I) c, ]1 j" P    move into pickaisle.induct1
6 A$ r1 q: x* x# g- [2 I    while A_i<=30 do begin) w/ b+ {) m' p+ t8 |7 v
        travel to pickaisle.con(A_i)
7 I, E. x, D5 D3 G+ Z2 K$ g3 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Y. m$ Z, h2 ]
        else wait for 10 sec
. c3 m+ {* g( ^4 z0 e: t, x        if A_i=A_leave then send to die4 _" E1 m, D% K- X! o
        else inc A_i by 1/ P  z- a0 |) v' O0 k/ Z. H+ i
    end
9 E' F4 ^8 s8 Z) D& x1 [! Y# c( Z% iend4 `! m, b+ t$ Z$ j! _$ g0 n0 \+ P

; H- S$ \" k, m4 B6 |begin P_pick2 arriving
! T  L' T0 q/ [" M' m" O  m    set A_i to 11" t: F/ g: ]2 _/ c0 i
    move into Q_induct2; s3 [$ u$ B# Y! \
    move into pickaisle.induct20 h$ y$ o6 {! k! ~1 S) {
    while A_i<=30 do begin
8 I  J1 Q, C7 k+ {' c2 u$ s  |        travel to pickaisle.con(A_i)
( N. P& M/ k4 J$ P* ~2 U$ \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- z0 K* }: M& L" a8 u        else wait for 10 sec2 b- _# ^* B" c
        if A_i=A_leave then send to die- X& f) u# z7 h  z$ D5 J
        else inc A_i by 1
+ k( t: a) A2 S3 E, h8 p  W1 |" [    end3 R9 A3 z- q4 S  w0 }
end
9 s6 \  x! B: Z+ s: V7 A( r- C
' O. R  d3 H, V, C1 V0 [6 pbegin P_pick3 arriving
8 F5 c" Y  h( {# {, v$ k, F2 h( U    set A_i to 21
3 D8 J7 v) h$ @0 }    move into Q_induct3
) e) k$ V1 n, i    move into pickaisle.induct38 G5 A: K$ t! L! ]5 W
    while A_i<=30 do begin
* X9 P/ J" l6 W        travel to pickaisle.con(A_i)' {% D) ^0 V) i4 h0 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ A/ K5 e/ D  e2 c        else wait for 10 sec
+ M  [6 X/ s4 b, y5 w        if A_i=A_leave then send to die
4 {8 Q' a5 ]; g0 _0 D+ }# o        else inc A_i by 1
5 B8 ?; D  N# J/ F: X    end
; x; W5 ]4 Z. g* B! p* S6 Z7 _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是个什么东东?  ~9 o! |2 W) a) Z  g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& U8 k/ E7 A& C) m' I5 `3 I! N! {' m) [" O( b8 d- {. f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 @  m1 f" n0 f3 _8 W0 G
8 x+ |. K. S  A" Z+ O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 Y3 e+ H" V& j/ ]) @8 k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( u* X3 W0 M+ G8 ]9 v7 [5 `2 w( D2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" O0 F& D  C( Z: v9 _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# \1 H# Q7 p! E  M: Ubegin P_induction arriving! T6 u  w' D. u# u
    clone 1 load to P_pick(A_induct)0 N: U2 q  V/ x0 T
end最大的系
# ?9 H0 `$ X. A' _6 h
: k- i, J$ m. Rbegin P_pick arriving5 b7 h6 z. k7 n1 G8 Z; w2 C3 f
    set A_i to procindex * 10 + 1, l6 l) b9 |; u# P8 d
    move into Q_induct(procindex)
* P& g$ s; `; N1 ~% Q) d    move into pickaisle.induct(procindex)
; _9 S5 |* Q" C3 {) t2 j4 B    /*check the type of pickaisle.induct(i), for your last problem.*/
# v9 I# e, ?  f- o
# E( I# K( q$ r) \2 k- ?    while A_i<=30 do begin
0 \: ]% P: d& \+ a7 n2 G        travel to pickaisle.con(A_i)! ~. m. d) E, ^1 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' k  P! u7 f0 _' f& s  l        else wait for 10 sec2 ^5 t( N% F) ^4 Q# G/ G( |
        if A_i=A_leave then send to die7 B5 Z& E; F2 }  n* y
        else inc A_i by 1
6 h" [* w- E4 y) o4 h    end. w" i) a" i  l) l5 d+ n
end
6 s* v; b8 j) |, Y9 F) G) }" S8 B+ @2 j9 [6 o5 Y( z- n
其中的procindex为整形,代表当前process的序号。
  L: r+ i7 T- Y) M8 Gstation和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-1-13 06:47 , Processed in 0.016287 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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