设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11657|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ R: I5 J& ^! ?
, O& @* U1 K( `% e! \+ ~2 e4 |我的问题是,在每个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中的数值,不知道会不会有什么不妥。, s0 c4 D( S; T+ K( @6 e
$ F1 V8 P! c& K+ M- t
begin P_read arriving1 n! u) E+ j; y+ q3 [
    while 1=1 do begin
4 M- l# [! P' Q: y' s$ d        read A_tote from "data.txt" with delimiter "\n"
; v1 j! f+ N) g        read A_time from "data.txt" with delimiter "\n"
8 L3 ~# r9 |0 L: a$ @; L- j6 r; B        read A_leave from "data.txt" with delimiter "\n"
% q6 W; P" x( I" X, e5 Q* `        read A_picks from "data.txt" with delimiter "\n"
9 o/ P6 K. i$ |2 x  _, s        set load type to A_tote2 }6 x! _# O2 A( ~$ d6 ~
        if A_tote="tote 1" then set A_induct to 1
1 m, W0 L! e$ n4 H- h5 ]& [        else if A_tote="tote 2" then set A_induct to 2
0 v  |& p0 Y0 q  k            else set A_induct to 3    ! u  H4 y: m; E! k) h/ {8 g
        set A_i to 0
* q7 m* g+ `& J4 ~& s2 ^  e! V        clone 1 load to P_induction7 u- ~7 y6 {5 O  o
        wait for A_time sec
/ ?# |# c/ U9 m' ?; b& i) ?1 }    end
7 ]( a3 p, ?3 Z* mend
' {6 {. L2 H# X3 k
2 ~5 `$ N" t* r3 ~! b" e, rbegin P_induction arriving
- I' B/ X7 v" V2 J    if A_induct=1 then clone 1 load to P_pick1- J! z  j* @. O% _& L
    else if A_induct=2 then clone 1 load to P_pick2
' b* g7 o7 P( t. x        else clone 1 load to P_pick34 }3 f- h( V1 Z+ n- g! b
end
$ Y6 m9 z# Q. ]3 Y! {7 D5 U' @0 }- n3 U5 J2 L+ I- K
begin P_pick1 arriving$ a6 {1 x# V5 t3 H- u7 Z6 m) m
    set A_i to 1
4 s2 ~" S! ~/ f& Z6 g+ s    move into Q_induct1# {7 s  ]) s3 m; k8 p
    move into pickaisle.induct1
  S8 V1 t* M* {  \& |! R0 u& E    while A_i<=30 do begin% X+ z0 y" \3 Y& J4 F6 q
        travel to pickaisle.con(A_i)+ U0 d' z, U: s+ b  x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, @5 _# f( t1 m) L# P- o& @# W+ k2 j/ n
        else wait for 10 sec
" [! F3 G  z& V# Q        if A_i=A_leave then send to die
  @, @' T" R3 \# ~! E        else inc A_i by 11 Z( u3 b; k8 B3 l9 I. }, N  \
    end
+ D1 L+ V  ^" U* T, h# uend
2 }6 }4 J: ]& J
. ^$ u, d, t: _$ ybegin P_pick2 arriving% y% D3 L( E+ L; \* t7 c) a7 b
    set A_i to 11
" Y$ x7 r- k. |9 K; a- y    move into Q_induct2, k% j; n* t* T1 l+ R
    move into pickaisle.induct2: T1 w' F& q( @/ D$ d9 q8 z: l
    while A_i<=30 do begin
2 A+ `& y. H( d, f* e# ^( \$ x        travel to pickaisle.con(A_i)  p- O7 g4 f; d( `% ~; u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ?& Q" o5 u2 p6 D  @
        else wait for 10 sec# ^5 Q2 N( w: \$ h7 f" T/ D
        if A_i=A_leave then send to die
8 r# G% S3 n+ B2 A        else inc A_i by 1
, s7 C& {0 F# x4 B    end
+ y/ e7 J$ ~" y: ~& Oend
. x! E' E& {% p  @1 {7 b6 E; C  H% k! T5 M- b* w/ u
begin P_pick3 arriving
4 E  Q) e# C- Z0 C' H8 P    set A_i to 21
% h- ]# h& y8 `, H    move into Q_induct3
  H# n8 x+ X$ [9 A2 u    move into pickaisle.induct3
. X: v: k1 s5 T  ]- R    while A_i<=30 do begin5 i  b$ q4 \( R; u  Z3 ]
        travel to pickaisle.con(A_i)1 ~' o4 B/ h( M7 Q3 u/ }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 i  p' W# ~  G# _2 q9 U
        else wait for 10 sec: w2 ^0 c3 V( @/ H: ?8 m) q) `( @) R
        if A_i=A_leave then send to die
/ W6 y; O# I$ |) Z/ |        else inc A_i by 1
4 E% w# Y3 t% K- s    end/ g. p2 T3 G  _0 a- [8 F# |
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是个什么东东?
# \7 x4 R+ z9 x4 Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ ^. E" y4 R3 j3 j; e: H' B1 M% J6 d& d9 u% ]) S9 e3 j
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 A+ A+ h8 ~* Q% C8 J1 y2 ]- ^/ V6 K% d% e$ H( R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 J2 z+ K0 F' f% S3 R- X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 }) i2 ], I4 C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% J5 s2 h" R( s/ A/ {5 R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" S( K: c/ H9 X' ^
begin P_induction arriving
0 S4 K3 q7 D. P    clone 1 load to P_pick(A_induct)
; I6 s; _. j# ^end最大的系
  S: k' c+ z# R' W& f1 m. c' c* G, J  E8 I
begin P_pick arriving! \* L; x! B; D' R7 w% u$ K
    set A_i to procindex * 10 + 1. K0 `. b. u7 \! S: B: I) I
    move into Q_induct(procindex)
% H1 A: l' U2 Z$ G8 G    move into pickaisle.induct(procindex)
  D$ z/ d) t, }    /*check the type of pickaisle.induct(i), for your last problem.*/% |) b; {3 j2 ~9 ^0 F) H
  a/ K" k5 I% \& h7 E$ w+ P. x1 O
    while A_i<=30 do begin/ ]) l! X: q: e, `$ p# |. w4 }
        travel to pickaisle.con(A_i)
" x( F; Z' J  `5 Z, N" D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. h; \  A1 b7 h
        else wait for 10 sec
" _! P7 J. T8 X/ [0 c% l3 J        if A_i=A_leave then send to die
6 h1 T3 U8 ~! @4 M& V: J. x4 S        else inc A_i by 1
: K2 G0 x: C- \$ z    end4 _( C$ b7 a* l4 L' W
end+ J7 D* D5 u; h$ M" G" C
" N7 i7 m! w6 ?9 ]) x+ D1 B
其中的procindex为整形,代表当前process的序号。) R# x# n7 E( `4 @. _! A9 [
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-11-26 05:08 , Processed in 0.026338 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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