设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13624|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- P  Z2 @% `% v9 y* O, H, E2 ~
( W$ y- b  H. y" K1 y! I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! }( g# D1 G5 i4 ^5 O! M

& ?9 }& v, n' d9 w0 Kbegin P_read arriving6 W/ O, ~1 O4 S
    while 1=1 do begin8 C" p% s$ [1 m1 o* {6 _  n( U) k
        read A_tote from "data.txt" with delimiter "\n"
( K5 D& H% F: y) N* X4 M# P        read A_time from "data.txt" with delimiter "\n"; b. W9 s6 `8 N8 w. Z2 u0 o; k
        read A_leave from "data.txt" with delimiter "\n"
9 J; I* d) V7 R        read A_picks from "data.txt" with delimiter "\n"' C3 ^* R' p! Q9 f# y. A/ n3 j, E+ k! K
        set load type to A_tote
; ?, l4 e. |, {. P8 u        if A_tote="tote 1" then set A_induct to 1
' m+ R3 ]( X5 g0 e3 \4 q  C        else if A_tote="tote 2" then set A_induct to 2
8 _0 e* T6 z7 X: F& q' \            else set A_induct to 3   
, w8 v, _9 l/ U6 w: ?: g        set A_i to 0& T4 C5 |# o# q0 g
        clone 1 load to P_induction: T% o; c* V4 ]' i; K6 _
        wait for A_time sec
0 \9 {* e# |+ U6 v    end
5 q: g# k/ u2 f2 vend
; \- [" R5 k$ B4 R  T; m$ r! b+ |( l4 K9 R, H6 d+ @  T9 v
begin P_induction arriving/ H  u- B% y' E6 w0 z3 R
    if A_induct=1 then clone 1 load to P_pick1
+ J# F8 E5 i. ^) s/ g    else if A_induct=2 then clone 1 load to P_pick2
& Y  y. `. D( m# Q0 z        else clone 1 load to P_pick3  A1 {# N! q: N- t: U) H9 Y
end& f& u) l& K) t- N

2 Y4 G, _, J: h7 H: z" t3 F) V1 `* Pbegin P_pick1 arriving1 ?& O; v( a: i9 e& D
    set A_i to 1
! {/ T% u' k6 \( J0 Z; y    move into Q_induct1+ g1 C9 @7 x6 v" }: t% x4 T
    move into pickaisle.induct1
# t$ @% l) w* y& U; q    while A_i<=30 do begin
0 G! d$ I7 n+ A! f        travel to pickaisle.con(A_i)
1 }9 n1 A, G- j% l4 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 i9 [6 V5 }* s, ^1 ]( q6 P; |$ r4 {        else wait for 10 sec
7 y# c7 I/ K% `" n        if A_i=A_leave then send to die) G' B' R, f9 K2 P7 s2 @
        else inc A_i by 1$ p. k' v, c- `" d9 p( `: y" \8 C
    end0 r7 t& |5 N* G1 ~) \- d3 i
end" P* \3 G; d8 C, [3 w
  m  H. {: Z% @0 d/ _8 i
begin P_pick2 arriving( J6 N$ {- w" p; m
    set A_i to 11
) E3 Z! S/ i4 g% d! j    move into Q_induct2! S/ K; N9 n- d* X! m
    move into pickaisle.induct2
$ W0 n( O7 D+ j$ d5 j8 F5 j    while A_i<=30 do begin
5 K) g% e0 Q: @& Y6 \; b& k        travel to pickaisle.con(A_i)1 @: Y/ f8 {& {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  V# I* J8 a, ~+ L4 c        else wait for 10 sec
6 A1 w% Y1 u0 k; ^; P4 C) x        if A_i=A_leave then send to die- h; |# d& \* r' j0 P
        else inc A_i by 1( |- G' Y: `9 @  {
    end
& \  p5 M! R% @: E' A: K# Qend
3 y& b! @9 U" x. O. F
2 J5 C, v  g" Y9 cbegin P_pick3 arriving9 A8 U. g! x5 @$ u2 e3 V7 v) U- G1 x
    set A_i to 21! Z4 C$ a/ }. T8 l( i1 y$ k
    move into Q_induct30 W* l2 O, S: M4 P- O" [: t
    move into pickaisle.induct36 r7 _! T* q' P' ^1 p; h0 }
    while A_i<=30 do begin
# @$ M$ V. h+ \0 y' y/ J        travel to pickaisle.con(A_i)3 M  b) ^4 H, Z3 u3 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" y; H2 n+ ]9 A' u" F' n        else wait for 10 sec
" b6 _  D  S' E, Q8 ?3 O        if A_i=A_leave then send to die
1 a1 P; D$ s3 ~' [" P0 z        else inc A_i by 1" m, k* }$ h* N
    end- b2 A0 |2 ?3 V6 ^
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是个什么东东?: Y8 R: @: Z" P/ h6 r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ X: W, X# Z5 l( V* i9 }" D5 f
6 C8 y  l4 W  L1 K0 ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 L9 S6 f- U* ^

. p1 O( H1 K1 E; d  p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ O" E' O; p- t2 f2 W9 S% q$ o" e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ n) `0 _! {8 F' ~2 j, m8 l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% g+ W% I/ g3 j" l) `$ O$ H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 M# z& Q* e0 c! P, vbegin P_induction arriving$ j2 r! b5 w- B0 K
    clone 1 load to P_pick(A_induct)$ D  O  [" P& }
end最大的系* a6 d; m  q9 }. h) ?) _$ c

7 [- s9 P( |! f' ~begin P_pick arriving! r, b$ A# ^0 V
    set A_i to procindex * 10 + 1
0 K' u2 p" A, y+ }, u    move into Q_induct(procindex)
/ g& U' w8 Z( Y( f# Y' l" b9 i+ \    move into pickaisle.induct(procindex)
# x2 B; ~' a2 u* j+ {" z3 K) V, A9 F    /*check the type of pickaisle.induct(i), for your last problem.*/
, ?( `7 j  L6 [$ V0 {
6 ?' ]& H0 ~. W8 I; j! Q    while A_i<=30 do begin. m# B$ v) ?' q% |7 p4 v- n
        travel to pickaisle.con(A_i)
# h5 E6 |& ]) z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ^! d  h0 O% g9 L1 O/ T+ j
        else wait for 10 sec
: U: _4 m0 ~6 i4 S        if A_i=A_leave then send to die  o' y; R4 ^) f6 n% E
        else inc A_i by 1: J  k( r0 D" n- h7 |; Z7 K2 T
    end
8 p, ]' e2 U9 ?% D: b" k, \2 @& k) ^end
& o$ u$ o- ~5 L/ _4 O1 G  C1 c: a
其中的procindex为整形,代表当前process的序号。( b- F9 k" c+ o
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-25 00:14 , Processed in 0.018738 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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