设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13469|回复: 2

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

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

6 U6 q: n, O" w! }& C7 h4 I( 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中的数值,不知道会不会有什么不妥。/ R+ c6 w- }# |

* u% r. c( s8 _6 f2 P( Obegin P_read arriving
! h5 Y5 o; P# l* u, a: c5 A8 T5 g    while 1=1 do begin
7 y2 Q- [1 L- i; J        read A_tote from "data.txt" with delimiter "\n"
+ N8 I. G) n& a; T' ~0 M) K9 W. [        read A_time from "data.txt" with delimiter "\n"
% t" J, c) J# h& I        read A_leave from "data.txt" with delimiter "\n"! g; D  p6 q! E# d% U% S4 M
        read A_picks from "data.txt" with delimiter "\n"
+ |% Q: s- }3 c0 F( `' N% ~        set load type to A_tote) N+ l( p& n8 t, e* Z6 f
        if A_tote="tote 1" then set A_induct to 1; p7 C. e) i3 C% u# J+ {) H
        else if A_tote="tote 2" then set A_induct to 2( m! @, ]% u$ @0 Y7 V% [2 Z' c
            else set A_induct to 3   
* s  r2 n4 J7 v# ^7 A" ^        set A_i to 03 Z  m$ j" h4 o3 |8 w' x$ e
        clone 1 load to P_induction
( N: m  }) A, j% A        wait for A_time sec5 n% g/ r. K' U- Z' G5 w
    end0 f( q' r7 y# n/ r: A' J
end
' O, k4 O) ^/ l
( Y% l  m# ]2 q2 g+ U# Pbegin P_induction arriving
* E  [6 S9 e4 Y, U0 u& G  r    if A_induct=1 then clone 1 load to P_pick1
/ t% \4 D; M( O& J1 q0 B1 s    else if A_induct=2 then clone 1 load to P_pick2& {+ _: N  Z  v
        else clone 1 load to P_pick3
2 q- O* W0 I: \, R. b. |3 aend
. r8 T$ C6 f/ O: p3 @( ]' B5 k% a- q" t7 q+ a6 h* P
begin P_pick1 arriving& D  ^& U) O8 S; z+ x: v
    set A_i to 17 w8 ~2 [8 I* E' W6 ^8 a
    move into Q_induct17 n; |' }7 F! |! Y- j' X7 X
    move into pickaisle.induct1
/ w- m3 d& I/ S0 B+ O$ L8 x. [    while A_i<=30 do begin& U- W  }! p5 u, t& I+ @
        travel to pickaisle.con(A_i)# m& B2 Q% s3 e& S5 X4 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 l! }# c% h; s1 L( r        else wait for 10 sec2 @* V/ P8 o' x& [5 \1 X
        if A_i=A_leave then send to die
- {/ S- O; t3 u' |9 ]# `- r4 e6 ?& D: `        else inc A_i by 1
. f8 e" W$ i1 n: A9 w    end
9 ~5 Z9 O7 `0 J) b" y# U0 Nend3 U0 u/ {8 U  Y6 v) B2 Y
( B5 U% c& r+ M* Z$ ~8 M, Q
begin P_pick2 arriving
+ @# z# P; O$ Z; W0 A: Q    set A_i to 115 c' H8 q/ x) g5 h: v
    move into Q_induct2
. X2 _# E$ l  {    move into pickaisle.induct2
3 Z$ d' {8 J) S3 }    while A_i<=30 do begin4 v& v% ^4 Q+ ^$ z7 w9 k
        travel to pickaisle.con(A_i)
# O  [, N) i' Q9 t# @$ Y5 R3 z) v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 `: c  n4 R% O4 I" ?0 W+ N
        else wait for 10 sec
0 K9 c- X9 T4 N  P% k        if A_i=A_leave then send to die. K7 j* B8 E% F4 d
        else inc A_i by 17 X: g" a* ^. C5 s& s  n  M
    end
* W3 n- J1 }9 ~2 Y* ~end1 p# }+ K% D1 E# K. z  w* {

2 k" M4 q- [' d5 V  \begin P_pick3 arriving8 C7 l2 d1 [9 `- r+ @4 {1 \" P
    set A_i to 21, U2 a+ r, \+ |% l) I/ T
    move into Q_induct3+ A5 m8 w5 k. U# j5 i! Q- v* {1 O
    move into pickaisle.induct3
2 T; F0 ]" F, n& }9 w    while A_i<=30 do begin& Y% y) w: g7 M% D) V( ~% F! Z
        travel to pickaisle.con(A_i)
$ z- Q- a* [( v3 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& _5 l$ K( ]. L1 v1 h        else wait for 10 sec
4 e. g" p6 \7 X, N  N        if A_i=A_leave then send to die* C1 t, O' V, |# S) k# C
        else inc A_i by 1
+ {# r8 q; g1 K# B0 z1 r    end( k7 ^% L3 R  B: ?& [0 {+ Z
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 L, n5 n1 q! }# A+ O/ Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 ]6 R# |( i; r( }9 V
$ O' K$ |# x" S' K" w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 J# ~# v0 S) |( u! |
0 n4 S4 ?3 V6 b  z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 I& ^: Q8 s0 I3 C7 b2 g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  I: V9 M8 B8 q$ H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 ]8 P$ J* \9 d4 ~2 q% d8 p7 F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 E9 ^  ^6 A1 Q; S$ e: C' @
begin P_induction arriving
, U- j0 X: k3 o, o    clone 1 load to P_pick(A_induct)
- w- B+ L6 k! i" r/ m" T* [. Wend最大的系1 ?1 S4 w- @: P$ f

/ |- L) J2 p1 B5 }) H0 bbegin P_pick arriving1 E# Y) t( f( w+ `
    set A_i to procindex * 10 + 1
. O" u0 E" d5 p    move into Q_induct(procindex)
# ]" `& x, n6 y8 Q+ a/ `    move into pickaisle.induct(procindex)6 o$ [% j5 W1 V# i/ M
    /*check the type of pickaisle.induct(i), for your last problem.*/2 p& u8 J$ B, M( }5 Q) m

9 q' ?( w9 \/ \( `; c, e    while A_i<=30 do begin: B7 f$ H# s$ _6 w  ~- ]8 {/ x
        travel to pickaisle.con(A_i)4 h+ N' s% T7 J: K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' I' C3 w( a( U7 _        else wait for 10 sec& P8 j2 q6 u2 x4 k# C5 z+ o
        if A_i=A_leave then send to die! T% g( A" N  |( y- G
        else inc A_i by 12 a9 M4 g7 X7 ^+ Y8 T& F3 D
    end$ l, w* N( t5 i. x* e8 p
end0 t* q7 D( E9 B" w
" t  J$ X5 i8 P5 E3 Z# E  |
其中的procindex为整形,代表当前process的序号。, u1 F6 @" S+ z) \- N& z. F5 b
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-4-16 13:29 , Processed in 0.015852 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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