设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13013|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ [: R0 S$ K! q# v2 q7 ~
* c/ m0 {/ |6 w1 u0 r, 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中的数值,不知道会不会有什么不妥。
  C* T& a5 u- X' [7 d8 U' l5 v/ u# }8 y9 h" S" F0 l
begin P_read arriving! m0 A% C- S# n
    while 1=1 do begin
& Z9 t& c+ J; L6 f+ m9 X        read A_tote from "data.txt" with delimiter "\n"% c3 H  t4 m* L& Y* N
        read A_time from "data.txt" with delimiter "\n"! @$ \! \; G, h
        read A_leave from "data.txt" with delimiter "\n"
# s8 N8 y$ o; V: P+ P        read A_picks from "data.txt" with delimiter "\n"# C) @4 A+ q: Y6 E9 G
        set load type to A_tote3 d! \; f6 ^6 J* U, w- d
        if A_tote="tote 1" then set A_induct to 1  y1 N, t1 `+ i6 `9 k4 C$ x& a
        else if A_tote="tote 2" then set A_induct to 20 J0 K  N8 J( i  C; |7 ~
            else set A_induct to 3   
- ^5 Z1 w' F7 P        set A_i to 0
0 R% l& f6 I3 ?9 {0 b        clone 1 load to P_induction( i  Z8 h5 U* X
        wait for A_time sec0 v: |4 G6 d. e% r) v! ^
    end8 }5 O$ R9 f* L/ _8 `, o% w
end' u- e0 b# h9 |+ s$ M/ |1 e* Y
+ b- I4 W2 v' E; W& t# E
begin P_induction arriving
. f# z- C& O7 L2 N    if A_induct=1 then clone 1 load to P_pick18 o4 S: O9 @- w7 j0 d% L
    else if A_induct=2 then clone 1 load to P_pick2
0 x8 U9 w, Z, W' F' m& V: x        else clone 1 load to P_pick3
, H) C. B* @2 G  Send
/ ]2 P9 c, {6 v$ S  p8 j0 Y( i
' w$ c3 g6 Y& [6 U/ e. E/ {begin P_pick1 arriving) b- ]0 `5 j* _" v
    set A_i to 1
* ]" e9 e3 }+ v; U8 T) I* ]8 w    move into Q_induct1  I& F* Y. o8 c' X" S
    move into pickaisle.induct1- d0 i8 ^: g# X2 S
    while A_i<=30 do begin
& m4 C3 F  z0 C+ C2 t/ b        travel to pickaisle.con(A_i)4 `2 M2 T7 F4 ?; T3 R, S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 `' z% H: f: [. O; W+ g4 z
        else wait for 10 sec
- P6 H' Q3 [. V- x, P% S        if A_i=A_leave then send to die. d! B* ^4 _" g8 r1 k) {7 ~
        else inc A_i by 1, Y4 q" `5 X+ U2 J, x4 P! u8 D
    end% J0 {% k4 Y4 W$ |# i9 w
end6 K: a% D) a$ j) r# r( u9 t
% [  Y0 W5 b* j& M4 Z
begin P_pick2 arriving% k3 L9 A7 w( A; G2 W
    set A_i to 11, E8 b' l) R2 p3 U
    move into Q_induct24 M3 }! |" H0 `
    move into pickaisle.induct2
1 U  M% v' y) @- M8 w    while A_i<=30 do begin$ I4 z9 T7 @/ F7 ^) K
        travel to pickaisle.con(A_i)
7 N6 o$ f3 O+ ?0 f; j& v: i4 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- k, `0 r" T' ^3 Z) \; E; C! t* _        else wait for 10 sec" p5 e; x( B  w; Q7 \
        if A_i=A_leave then send to die
/ n; H8 j/ Y, n- _' Q        else inc A_i by 1) \, [/ n# s3 r
    end% I! b/ k% T' |. \
end
1 W9 i0 B' A( o; y; ?0 D8 I+ t, e# U1 _( K! }5 ~* {) F
begin P_pick3 arriving5 ]7 u" L& x1 X( s  D  F. Z& m
    set A_i to 21
  E1 J/ ]- F% c% N    move into Q_induct3
8 E5 {6 r2 M! O  \7 N8 C    move into pickaisle.induct39 G3 T% s' r! `% d
    while A_i<=30 do begin" {* l: b# Y* `  \; p% q+ _
        travel to pickaisle.con(A_i)+ K& j) |/ E1 A- z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. M+ }# `; G2 [6 {" e  m
        else wait for 10 sec7 g# E- B8 t" u
        if A_i=A_leave then send to die6 X4 v$ a: Y; L6 N0 T' l
        else inc A_i by 1
/ S/ H3 T9 u! Y/ b' V* a( K    end
) V1 u0 |( q* K0 W# z  D  qend

最佳答案

查看完整内容

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是个什么东东?
: E) H3 C- ?' o- imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 _( K  h+ A4 {( S
4 Z! R' R! S# LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 t* a( S7 f& L( i% m2 |$ c" [7 n
+ p9 ^* Y( g# x3 B% f5 C
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 r5 r* k4 K/ z% I7 U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) W3 l6 z  g7 f! O% b7 S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! X5 w( k9 _3 r: I7 G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 g% [- ~; T7 c8 o9 W( ]" sbegin P_induction arriving5 w, c* W& J  z" }& q
    clone 1 load to P_pick(A_induct)) c$ F4 p  c2 ]: {* y( X1 K
end最大的系& N2 O( }/ m# r" }" \
6 q" O5 n% t4 O8 L0 D% a* ]1 P; b
begin P_pick arriving: }$ R$ O& F* J) S3 O6 |, Y- p7 ^3 ?
    set A_i to procindex * 10 + 16 @# E) r9 H, [7 F7 s5 P( Q% X- k
    move into Q_induct(procindex)
- p: m, r$ O" {4 t+ p    move into pickaisle.induct(procindex)* _8 c% W4 f7 }6 L$ O
    /*check the type of pickaisle.induct(i), for your last problem.*/2 G4 e# D/ Z5 T+ Z) g1 `
( D/ F$ Z) Y1 l9 x" @9 J
    while A_i<=30 do begin
2 {" j, V5 i3 Q- P- e( g, J/ Q        travel to pickaisle.con(A_i)$ P% ?+ W9 D  i: \" v% V6 H" C! ]2 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u  o5 I' w' s. H0 X        else wait for 10 sec
2 s0 E% O$ M* ]/ {, r# C% M        if A_i=A_leave then send to die* w$ @) D( y  g0 |9 @$ `
        else inc A_i by 14 f4 i$ g+ e1 m+ J9 ?6 N
    end3 h% q5 B7 I5 h; F1 U  D8 w  S# h- Z
end8 D  D" V1 H# D7 t) w# O+ n! O5 D/ q
; m. S* I. V1 H, M" o
其中的procindex为整形,代表当前process的序号。, a7 I+ j, d2 }) k
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-3-11 06:07 , Processed in 0.023253 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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