设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10676|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  _' W% N/ |* o( G; O3 Y
/ h' v6 \8 ~, d1 M3 D  W/ L我的问题是,在每个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中的数值,不知道会不会有什么不妥。. |: F  X! m1 s0 t
: R. d7 A. E+ m5 N* t+ z
begin P_read arriving6 A  \0 h  c9 j6 \! l
    while 1=1 do begin
$ r% B( V1 _* i) r* ?        read A_tote from "data.txt" with delimiter "\n") r* ]# `4 E3 N% \
        read A_time from "data.txt" with delimiter "\n"6 U* ~+ p3 M$ Z6 a; F* p1 l4 u
        read A_leave from "data.txt" with delimiter "\n"4 m; W/ c- Z2 _3 s- J
        read A_picks from "data.txt" with delimiter "\n") M* I8 V5 u4 |8 L% g
        set load type to A_tote
9 [0 P( F" {! n: I5 \        if A_tote="tote 1" then set A_induct to 1+ F1 ?) o* R6 R! }% @  r! k2 v
        else if A_tote="tote 2" then set A_induct to 25 o9 c- d- ^3 r: Y+ u# p
            else set A_induct to 3    7 {7 {1 K8 U9 D) z. _: N' ?, i
        set A_i to 0# k1 @) Y) ?) r: C
        clone 1 load to P_induction9 }4 y8 F( }! B& @+ L: O$ M6 p
        wait for A_time sec
% R) C  k! v( l4 u$ O8 _    end2 ^' j8 @) N& w2 j& \5 R" l; D
end/ `9 e6 T9 \. X7 H
+ H! |6 _8 X' R4 H; z
begin P_induction arriving
; O5 t" F3 f0 }, e' S    if A_induct=1 then clone 1 load to P_pick1
2 I( [9 n, I2 [$ p3 _    else if A_induct=2 then clone 1 load to P_pick2
" \7 {* }8 ]: ]$ ^. U  \  d        else clone 1 load to P_pick3, H; H  @* V  d) D; v6 K
end8 ?1 T0 J, u$ Z  I

( Y, }, j0 e7 {# s, xbegin P_pick1 arriving- s5 G0 h4 C6 M% ~
    set A_i to 1. d5 Z; V4 Z1 \# M) q
    move into Q_induct1
5 Y: v$ K* k/ i: K/ J    move into pickaisle.induct1
' ]: F6 q2 x  Z( u: s4 T    while A_i<=30 do begin
! g& e; K8 v: D6 q  Q! O& g        travel to pickaisle.con(A_i)
2 c) F. w# w7 O! K# A8 g! K, \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: S9 B7 d2 _: z0 B, R  H6 m
        else wait for 10 sec
( l8 k& k& ]+ X" R$ o: w        if A_i=A_leave then send to die
5 P; k1 r9 @/ V. U6 t        else inc A_i by 19 D6 Y; T& W( L/ Q1 ?% X, C
    end- d# y/ K, _2 o/ I
end" w( F  ]: Y* S$ O, p1 q

- B0 k" S' u/ ubegin P_pick2 arriving7 s) B  D' Q' d! }5 m( D
    set A_i to 11- w6 F4 b) k1 E1 h" H
    move into Q_induct2( M% [; b, ?0 T; h  X+ R- ]6 v
    move into pickaisle.induct2) Z; r2 d/ v% {3 T1 e" z4 d/ x4 v: c
    while A_i<=30 do begin
. m3 j6 t# j4 r2 Q% K0 |        travel to pickaisle.con(A_i)
- `7 p' I* @! h; l/ X; ~1 m% Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' d' {* r9 K. y        else wait for 10 sec$ h% L" l" W- ^$ z( a& v
        if A_i=A_leave then send to die* l4 f/ c! t/ J# |! R6 S+ v
        else inc A_i by 1
& ]* T# O" x9 X/ M8 E: z    end
5 f' c- ?! l* Gend
9 {+ g+ w1 f0 }  l  P5 V' v% E; E- [
begin P_pick3 arriving6 }, C/ c. Y% u
    set A_i to 21
3 h) Z: m7 g# X$ N. C    move into Q_induct38 ]9 Z. Q; w- R* \
    move into pickaisle.induct3
0 ], {0 @4 \' \4 l    while A_i<=30 do begin, p- P) d' V1 ?* y6 ^- }. z! Z$ ^
        travel to pickaisle.con(A_i)5 n$ e1 W/ e: l! ~5 R. L) \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( m3 {( s1 ~3 U; {- o# T
        else wait for 10 sec/ n& x* J9 M0 s; s" F
        if A_i=A_leave then send to die
) n+ H$ M0 K# d+ }; s! H        else inc A_i by 13 B- G2 C' d$ S
    end5 i7 F" c7 I# P7 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是个什么东东?
5 r) i/ {4 M. |( `- b( y0 E$ ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 w; V# I+ X1 T, R, }/ @
9 G' z$ I3 P) L$ c* {9 d+ A8 q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 Q/ L3 M: P3 W; A/ ?! ^4 n( S! [7 o$ X" w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 P! j5 X/ r: H3 }- k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 |  h0 R- n/ F$ @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: i" h* j8 ^# g4 w' ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. z6 R6 J9 L2 T3 ?$ G
begin P_induction arriving/ u3 s4 `. B" x5 K: c- [  w3 \" P8 W! r
    clone 1 load to P_pick(A_induct)
  V4 Z* T5 z& U* H, I* L# S& q$ Rend最大的系
; Q" x3 j. ]! d6 X1 s: L  K1 O) L  A# @
begin P_pick arriving
3 O& I* R, n  _$ c& c    set A_i to procindex * 10 + 1! E8 N/ w: F% C  o8 f9 U* }
    move into Q_induct(procindex)! F  T8 L# z7 N3 o
    move into pickaisle.induct(procindex)& E# }' J6 q! ~
    /*check the type of pickaisle.induct(i), for your last problem.*/
  z. n- h3 W6 c4 k1 I
6 i- C  Z% R' ~1 q& ]/ C7 e; u' O  _    while A_i<=30 do begin
. l3 z. l, w2 g% n) v        travel to pickaisle.con(A_i)* ]3 Y1 p7 r% q& [9 `6 A6 k2 m7 n. q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ f1 T# a& q" w, F        else wait for 10 sec
! ^0 k$ t% L% \  C$ i  U        if A_i=A_leave then send to die
& ~3 |( e% z6 p        else inc A_i by 1( `' l3 m7 y4 D" V) v
    end
1 }7 V! Q( _$ D- mend! w1 j9 v7 N7 ?5 B; \$ T" J1 b. e
2 I( a+ m/ S1 M9 I! \* M
其中的procindex为整形,代表当前process的序号。; C* r6 U0 R# t- A/ U
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-9-18 18:47 , Processed in 0.014972 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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