设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14217|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" E# M: U; J$ K2 j! m. Q
9 _5 z( k6 G/ P& q% C* m7 T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 a9 h+ h% t0 S+ x- N7 j8 {* s9 A- Q
begin P_read arriving
- M/ X0 ]% g% u    while 1=1 do begin& R. T$ z2 ]: _# C# M9 m4 Q4 U$ n, x% Z
        read A_tote from "data.txt" with delimiter "\n"
5 J& y7 N2 N5 i% h        read A_time from "data.txt" with delimiter "\n"5 V/ G2 l& i0 B# S# J. P) \: p
        read A_leave from "data.txt" with delimiter "\n"
! T* u& t9 A. {* C" p. K) l        read A_picks from "data.txt" with delimiter "\n": g0 i9 d" [/ c6 t7 e5 N
        set load type to A_tote
* k) q5 b) g7 f        if A_tote="tote 1" then set A_induct to 1
% ~1 a8 j6 a5 G! T% {        else if A_tote="tote 2" then set A_induct to 2
' w7 f* v! Y; M/ i/ r            else set A_induct to 3    4 H1 ^/ i# Q3 h2 t- }$ F3 V
        set A_i to 0
7 K9 |& [9 u# |        clone 1 load to P_induction
# b2 p% W8 X9 W1 V( x        wait for A_time sec
; z( L+ l% n8 [: I8 ~& f" v; B    end
, x% N7 {2 L6 n0 Y" Bend7 I' q# K& O' B: n1 f+ c0 j2 }

+ q' i: }1 R# u; cbegin P_induction arriving2 N7 i% L8 \/ Z4 e1 p
    if A_induct=1 then clone 1 load to P_pick1
. n: c" ?6 h, a' e% e8 C6 j    else if A_induct=2 then clone 1 load to P_pick25 q0 j$ y! P% @3 w. @% `* ^7 y7 V
        else clone 1 load to P_pick3( C$ \, N. x1 j  L+ z* n
end+ T% g! n4 E8 _7 O

5 y) [/ a: U  j$ e% zbegin P_pick1 arriving
0 u2 N+ }: l( z7 G# b    set A_i to 1- g$ {8 v" c) M
    move into Q_induct1
, R! f7 v9 S+ ^    move into pickaisle.induct1
2 V7 |$ K0 Y$ `: `$ V    while A_i<=30 do begin
3 \- ~3 Z+ }( p* V+ I$ A+ p& T        travel to pickaisle.con(A_i)4 m5 P$ c, y7 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ M, u" y% k9 O0 D) P0 f        else wait for 10 sec
$ K  w5 S2 m$ g- X  n        if A_i=A_leave then send to die
* x" J7 x% f' N2 S$ d        else inc A_i by 1- |( h6 L' D$ h* k
    end
) d$ a  H* y' Tend
' B  H% @9 j# l$ S# ]6 G1 x8 l4 g: d; M8 h) B9 m2 Q4 g" R
begin P_pick2 arriving, L9 m3 T" g( }. v9 L6 a
    set A_i to 11
! o0 T; L# u5 r    move into Q_induct2
' x) j, q& K; j4 Z+ |4 C$ i8 F    move into pickaisle.induct2
5 H; i! X3 B9 e( ?- K    while A_i<=30 do begin
  s8 ]: a/ W. V' F3 {* ~        travel to pickaisle.con(A_i)3 R8 u+ ~% _, E" ~( g0 O; e' [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- X0 s$ E/ t7 f- E, w+ T. K( b        else wait for 10 sec
* F4 ~& b  V* l7 h        if A_i=A_leave then send to die: A; w, c$ u% B) y9 ]3 H: @) p
        else inc A_i by 1
" i7 u( d- Y9 O8 ?2 k1 i3 F    end
: J) C5 z5 w6 u# f9 [; }$ x: X7 {) iend! G- y, y0 V4 W) H
5 w  B8 S, E  f; e0 j8 x
begin P_pick3 arriving
  Y7 N- C; d! i# ?. Q* s    set A_i to 214 Z7 g, m9 o* G' E
    move into Q_induct3& z  W6 a  ~4 [2 I7 C+ N
    move into pickaisle.induct3
$ u" ~! K% [5 m: ]$ S7 u1 v! |  `    while A_i<=30 do begin
$ A' B5 _9 _# \% L        travel to pickaisle.con(A_i)
6 @; h  K6 i% D/ |2 B1 H5 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, C* |# ^9 L+ C. _        else wait for 10 sec" a+ M! A9 n% N! Z' B
        if A_i=A_leave then send to die
6 j" i/ V7 @9 Z" g) |8 _        else inc A_i by 13 g' {: g3 ^6 J
    end7 p/ f- a( J0 U
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是个什么东东?' R  k7 k: Z- P2 E% f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" ~5 n" ~% s5 r& s% @' Z
- M+ p% U" R% f6 v# }( x' s) tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ n1 \( k7 Y4 j, J1 r

5 t( C! h# g& D. u2 G9 W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ H# g/ r! U0 C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  `+ Y) S" }/ B! g) y; O9 u; t( a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" c% k* D( r, m- A; H" \7 j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ w5 u& _8 F) f% N- v, u2 y% Sbegin P_induction arriving) ^; ~3 ~# x+ A5 g" K# y; p
    clone 1 load to P_pick(A_induct)& d( D* O7 a$ [* U- t/ w
end最大的系
( n3 Q% @7 R( G1 m' R* y3 z
3 |: j4 f, e% X0 L, ^begin P_pick arriving) \) T5 O0 O- g1 @
    set A_i to procindex * 10 + 10 h0 S! H4 d% T! r+ E) d
    move into Q_induct(procindex)
$ H$ E/ I7 B  R; g; {% Y. J9 u    move into pickaisle.induct(procindex)4 p6 M5 _+ ~# p
    /*check the type of pickaisle.induct(i), for your last problem.*/% T/ P( b- Z2 x1 x. X! @4 e( h
8 y3 A6 @( o& I' V2 b
    while A_i<=30 do begin8 S1 M: ~* [' O" F
        travel to pickaisle.con(A_i)
" D5 h+ j; ~# Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) Y7 @* `, _7 V/ {5 r        else wait for 10 sec( X7 K& l2 T7 e
        if A_i=A_leave then send to die
+ f- q- @( w* Y, Q9 h: `        else inc A_i by 1
/ N4 o) P' b' e+ X    end
3 i: v  Q# B0 F2 y: D  Lend; @. b/ k4 ^, _8 Y
/ F! B' F$ Z  ?( H- @& J% ]! C/ s$ b' {
其中的procindex为整形,代表当前process的序号。
" e3 h* v- d- C* F1 L6 A# j3 rstation和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-22 00:42 , Processed in 0.016468 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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