设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12842|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  P9 K2 u1 ^" K, `7 y
5 O( y, N7 D; }' n# }& C& d
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 J) S; m" |9 Y+ _3 }: h9 q
' o3 \* x" S' A/ D6 m
begin P_read arriving
4 J2 s: R# q5 h& P    while 1=1 do begin
# r. _9 Y& n( o        read A_tote from "data.txt" with delimiter "\n"# N: N* q) c  }/ p
        read A_time from "data.txt" with delimiter "\n"0 }1 ?$ J4 R5 d- Z1 P: g6 B
        read A_leave from "data.txt" with delimiter "\n"
9 J7 x; |; R# ?5 K0 n        read A_picks from "data.txt" with delimiter "\n": N/ P5 V: K2 S1 `8 p. G. i7 u- |
        set load type to A_tote
' c- a/ I( J6 ]* ?        if A_tote="tote 1" then set A_induct to 1
7 C. ]: j; e/ Z9 r# @        else if A_tote="tote 2" then set A_induct to 2
; ?1 B- ^. u. b! g) X/ K' }            else set A_induct to 3   
3 s6 K5 g7 {  k8 ?, T        set A_i to 0
  H% ?, X, V9 k3 W% B        clone 1 load to P_induction
3 V/ \! [5 \3 ~6 u9 U2 j+ {        wait for A_time sec
2 \; v9 z% b* }, r    end! R' c# \$ {2 I) a8 k# {% |9 W
end
$ c4 o5 E, w$ y3 ]3 D+ H5 X( f$ P. Z, {7 Z4 c9 \
begin P_induction arriving9 O$ V$ f4 K9 A7 a( U( d# x( A
    if A_induct=1 then clone 1 load to P_pick1
. W) E& v6 [3 n+ C1 g0 W' {! ~. N( s    else if A_induct=2 then clone 1 load to P_pick2
1 x! k7 B2 Y5 |" k        else clone 1 load to P_pick3
# M- P" E0 _' u2 W5 ]end1 x$ s+ I/ H) c+ u6 y

& k2 n3 W' u- D' A  X+ nbegin P_pick1 arriving, _- z8 q! V6 q/ o$ }& P4 \
    set A_i to 1
' G, {0 c+ \& z  \4 Y: Q: |! Y    move into Q_induct16 s/ l! V7 b5 `, t9 S
    move into pickaisle.induct1
1 _3 W+ X: f4 u% c9 ?8 |# Q: u    while A_i<=30 do begin& C$ t% h, X4 s: I9 T  i
        travel to pickaisle.con(A_i)
  z6 ]$ C# W/ g: J( [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 C) {' L/ D" B7 d7 }        else wait for 10 sec
: Y% M. G3 {- `+ J- A' [9 z        if A_i=A_leave then send to die" Y9 |4 Z% N9 ~5 X/ C
        else inc A_i by 1$ W9 [: O" n6 K  Q3 d4 H2 z
    end7 r, k; {3 {6 C3 F( x1 c) z* u4 p7 H! h0 ^' M
end/ t% P/ p. D3 u# d9 X" X, ]* z

$ b9 F# |2 g( ~6 _& D4 Y0 x3 y$ Obegin P_pick2 arriving, G- r9 A. T2 r, f5 P: ]! S6 u
    set A_i to 115 Y8 q9 F8 A& B3 U# s( Z' J8 f' Z7 }6 m
    move into Q_induct2
8 w, M0 C$ [6 u# X; p  ~0 M    move into pickaisle.induct2. q6 ]7 Z# t/ R# g+ a( I
    while A_i<=30 do begin
1 f  ]7 d6 J+ p) l& u' [        travel to pickaisle.con(A_i)- F" P: w! j6 N, d% \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X1 r: C$ g( ^; c4 Y; C: j/ U- v        else wait for 10 sec
$ B8 [( W) ^# g% i        if A_i=A_leave then send to die
+ F6 Y; z0 ]. f: @0 [% y/ C6 W        else inc A_i by 15 G7 g  _- y' o$ [. a" e
    end: X; l( [# P/ J
end- ^0 a3 V" B5 t
* s* t. V- v# F
begin P_pick3 arriving
7 T9 D, t  b/ }* `# n9 g: Q    set A_i to 21
: w& y1 d5 P( y; F# c/ O    move into Q_induct3
' C5 W+ Y# v8 [  L( Z+ K    move into pickaisle.induct3+ {& Q" ]2 C8 f) }
    while A_i<=30 do begin, Z$ {- F" X4 r- m0 u, X3 y; \
        travel to pickaisle.con(A_i)8 ?- P* O, d# ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, F% N8 |# F* Q/ }& R
        else wait for 10 sec% M# q3 f; p7 @9 x7 m/ c2 Q
        if A_i=A_leave then send to die9 t* B# B0 D9 |( R  L) ?7 z- d
        else inc A_i by 1
/ T( y3 i$ {# d) c" C1 v4 O# E    end
& I5 f; E# K) L% d" V) v7 l& v8 p# mend

最佳答案

查看完整内容

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是个什么东东?3 K4 g$ Q* f- N- P6 Y7 b# Y- k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 C5 h  }$ m8 n$ J: E+ Z4 A% H
. l* x0 C' q: r- ]3 a. ~) w7 h0 sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! v: a8 i3 Z) p/ }- x, t/ T( W' c8 c

8 x# ]& ~. c* [$ j' M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ O# [: {& z0 ^+ j$ @% x/ E2 x; l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ Q/ Y2 G1 p; g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 N" \; p) O: _2 ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 z0 }( J1 a' q: Rbegin P_induction arriving
4 B$ e8 B/ j5 u    clone 1 load to P_pick(A_induct)4 A3 K) v! Z4 ?! L# l. }
end最大的系% Q9 ^" Y! v3 c

6 _0 l" A' m& T0 E& ^- p# ^begin P_pick arriving
/ [  Q. ~4 N# z! R0 _- ?    set A_i to procindex * 10 + 1$ }9 \3 V. e: q5 K
    move into Q_induct(procindex)
6 `3 G) Q: D& O. Y    move into pickaisle.induct(procindex)
9 E9 ~( P2 W% J% S) a9 g    /*check the type of pickaisle.induct(i), for your last problem.*/3 {, F6 R2 {/ Q, z- u: ]3 F

9 x0 G; X! N/ K2 K/ C8 m    while A_i<=30 do begin5 S9 D' l/ @6 M5 ^+ O
        travel to pickaisle.con(A_i)
7 Q0 H9 P# e7 [& j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 u" @8 m' x0 Y/ b# ]        else wait for 10 sec
, a1 q5 G3 X6 a. L# f8 I        if A_i=A_leave then send to die3 A% Z8 w# `4 [1 u  I
        else inc A_i by 14 n; W4 |( r' j* t
    end
6 f, q8 O6 N) d' Y. W/ M) c: Nend
/ q: e  ~1 R( i6 C5 x3 l1 x: Y7 X3 [. s' Z
其中的procindex为整形,代表当前process的序号。% v( |6 U& [. U! V. a
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, 2026-2-24 00:30 , Processed in 0.017484 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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