设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14097|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' W/ k/ @  f9 S/ b2 O

  Q  X5 A# v  L& u" f我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! Y  T. |; d- |% N" i7 `
* I. n* l( d) Hbegin P_read arriving
1 k1 @" J* |$ j) d! y$ V    while 1=1 do begin6 P3 d: U/ k5 O- ^
        read A_tote from "data.txt" with delimiter "\n"7 w! o( O" L$ t
        read A_time from "data.txt" with delimiter "\n"
* U  S* f) X  _        read A_leave from "data.txt" with delimiter "\n"
- O( u( F, W, ~5 z        read A_picks from "data.txt" with delimiter "\n"* R5 i* g- H. l4 A$ o' b' {
        set load type to A_tote$ W! E* ?& ?3 B$ z0 b
        if A_tote="tote 1" then set A_induct to 1
! n+ T: @$ a9 A* i  m        else if A_tote="tote 2" then set A_induct to 2. a0 i( s+ z8 y' U3 n9 A
            else set A_induct to 3   
% n  j4 y( p( l4 y- D8 |: s4 U$ j( _        set A_i to 05 w, \6 Z" m; m: _1 b$ e6 M
        clone 1 load to P_induction
6 i0 z: ^/ c( ]        wait for A_time sec& R! e3 E8 }8 h* P; ?% f5 Z3 T
    end! y- e0 E7 Z1 P6 \+ o
end0 Y3 t9 @- |9 _) w/ G, J2 R

9 i  l( h# [" L  H/ pbegin P_induction arriving
( v1 B# f: ^! Z2 I5 J1 k    if A_induct=1 then clone 1 load to P_pick1
5 }- z) r* a' t! b0 M' Q    else if A_induct=2 then clone 1 load to P_pick2
# K. s: n" |* f! @9 L- z# {        else clone 1 load to P_pick3
8 }$ E# B* H& [4 lend
/ b5 r0 w$ H) I1 @/ W: @# b% l& |  Q8 W& G# ^1 X& i$ v
begin P_pick1 arriving
8 {. V, Z0 E$ f3 X* P5 r" i    set A_i to 19 c8 p7 e! R( `
    move into Q_induct1
7 ]7 x: T8 E" J9 ~+ o    move into pickaisle.induct1
6 t% `' L! X; q- j) T+ O- m- [) d8 ~6 Z    while A_i<=30 do begin) p. v0 [, O5 o7 L
        travel to pickaisle.con(A_i)7 v1 {8 d9 R' H  Z4 _  O1 Q7 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 _! x: [1 f+ L# g5 f6 N% v! X
        else wait for 10 sec. m- A5 X0 o- a
        if A_i=A_leave then send to die% c5 F% U  U# P6 I
        else inc A_i by 1: Y& j0 [0 u9 u8 \) G8 H4 L
    end
  Y; u" D5 ^' K) U( Y( \# Iend0 N9 b0 c+ A6 U0 ^

& d9 Q) f+ {) Z# h! I' m% Obegin P_pick2 arriving* N7 A# `3 k4 o" Q: B7 v
    set A_i to 11- d  U. A. j0 j6 ?) L& K: U# t
    move into Q_induct2& l4 \% i- O( O
    move into pickaisle.induct2
9 O; y5 Z7 m7 I8 ]) x" T    while A_i<=30 do begin9 p9 R+ |$ }6 \9 I1 Q  S
        travel to pickaisle.con(A_i)
# Z9 [- ~: t/ d( n6 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 U3 H0 s0 D6 Q7 b0 b: U. l
        else wait for 10 sec
+ _9 v/ B+ v6 _2 ?        if A_i=A_leave then send to die
& G) f5 C+ q5 A/ r! Z  B5 a        else inc A_i by 1
* I* G1 r; H. p+ }2 z  S    end0 Z' U( t1 p: X. n1 v
end1 J# t) b* r+ f' L7 U# z& W

" `/ \% V! Q! y3 C; J: V3 [: tbegin P_pick3 arriving/ O& g+ S$ [% q% D8 v  L7 A, m: Z! t
    set A_i to 21
) o$ I* l* E' D3 f" |    move into Q_induct31 L7 j9 [# S9 u) X3 z5 T
    move into pickaisle.induct3$ K" s* B5 z+ n! j
    while A_i<=30 do begin
2 @6 `" l# t$ R1 F  n/ e        travel to pickaisle.con(A_i)
! \  R) Z( j3 b% s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. B9 Q# b  U3 V6 V/ R3 ^        else wait for 10 sec
& h* y1 P# [  D" ^& f& U8 ~9 I4 M        if A_i=A_leave then send to die
$ w( D( l) R  W8 h3 V$ [        else inc A_i by 1
; |" W" v  i% j) Z  p    end
0 D3 C! `8 M4 P4 Nend

最佳答案

查看完整内容

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是个什么东东?- m# `0 t$ i0 ^: ], [- n0 Q& o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: Z3 D( \/ H( f- s% s
: c# `: r) x2 f+ g8 c9 H* L. e8 d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- C! a' X0 i  C' b  _! D6 I
4 U! l, ?# d: k) g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  I, C; Q4 s# t6 m( K% K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' q# v6 X: i6 U7 S1 c. A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" h/ ]6 h( n, f) p# K! S
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- K' W$ k* U7 f: Y5 Q1 p
begin P_induction arriving2 O4 b9 w! V4 a8 Z
    clone 1 load to P_pick(A_induct)
9 h% w6 U1 T" ^& h: F4 tend最大的系  T3 X' v7 f! Y/ ]# b

8 t4 A) D8 b& @, S: e* r; Gbegin P_pick arriving
) \! b- |4 v6 N3 H5 X0 p    set A_i to procindex * 10 + 17 N/ w0 F" d# p" P
    move into Q_induct(procindex)( ]; A& b# L2 I2 a% L3 ~5 ~
    move into pickaisle.induct(procindex)6 C5 n# n: M& _) G4 ^6 }
    /*check the type of pickaisle.induct(i), for your last problem.*/
; s/ W2 z7 D2 d+ e& ^4 `0 {9 P: f; ^/ z2 y- g0 R' O
    while A_i<=30 do begin3 i$ ]% V5 ~  B  t
        travel to pickaisle.con(A_i)+ {+ H7 c# f3 P" c1 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 c; [  y  f5 s
        else wait for 10 sec0 h7 t: d/ D  A" K, `
        if A_i=A_leave then send to die. r) e# d8 Q$ K( F8 n% b
        else inc A_i by 1
# t6 o8 ?& F1 ~: v2 {  d    end5 y- a: E' r& z4 r3 P  P4 X& l
end: `) X! E' ~- u" r- }8 i& W$ b
0 q7 {! [8 |; p/ q% ?! [
其中的procindex为整形,代表当前process的序号。
1 Z2 y4 F% P6 I9 q. T6 Kstation和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-6-8 12:59 , Processed in 0.015338 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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