设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13959|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 e  R3 P4 ~/ w4 [$ w* @. v
7 P( C! ]' r" ~. C$ s我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 j/ Q8 T2 a/ j6 f0 @, M
, h3 z1 h2 N# U, x/ M& Pbegin P_read arriving6 G/ c% m& s( v9 S# |
    while 1=1 do begin
$ }+ o6 _: h# p+ `/ W2 R  K        read A_tote from "data.txt" with delimiter "\n"2 X, l8 c% P, T) K  g# O
        read A_time from "data.txt" with delimiter "\n"
6 N5 a+ h' C5 y( `        read A_leave from "data.txt" with delimiter "\n"( }6 X6 R( f( Y
        read A_picks from "data.txt" with delimiter "\n": v! x9 z/ A, b) x& f2 I' \
        set load type to A_tote2 f% Y6 U5 F8 T# R
        if A_tote="tote 1" then set A_induct to 1
) l6 f# a; w; W1 \$ ]& W        else if A_tote="tote 2" then set A_induct to 2+ [8 M, H' o: I: _
            else set A_induct to 3    8 s. \/ `* N1 l
        set A_i to 02 Y! p2 r: W$ }: ^0 l
        clone 1 load to P_induction
( R9 j6 W6 D* e' L        wait for A_time sec5 ?! g3 p  V) k' T
    end  \* G1 c+ ]. N- O$ y" D
end! d; \, v7 Z( g. d7 x
6 T5 G$ D" d: M4 s9 M5 M! Q0 w! }
begin P_induction arriving
% Z9 h' [4 q; U, B# L7 u    if A_induct=1 then clone 1 load to P_pick1
4 q; h' u, U. V0 ^0 k" R) }    else if A_induct=2 then clone 1 load to P_pick29 N! |8 l7 K# ?1 ]2 f* b" r* E
        else clone 1 load to P_pick3! s) t+ q& s9 }' j) k$ k
end
8 a" j- g6 ], k/ L0 d
& r) U% W5 ]: Y1 Bbegin P_pick1 arriving% z1 B) K; j, k) c! p1 |/ g" |5 N
    set A_i to 1
" X1 n4 t' Z# |    move into Q_induct1; k+ _, t# Q: |) l9 Q0 F
    move into pickaisle.induct18 \) x5 w  }$ i' a* c! W( a
    while A_i<=30 do begin
+ \8 p, x/ T4 x, Q        travel to pickaisle.con(A_i)
9 \7 @, ]1 W1 D) {6 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N: I9 K% A" j* U' X; _% r' S        else wait for 10 sec
6 t5 f2 d/ Z" V: e        if A_i=A_leave then send to die3 s$ q, f* D/ d, `/ i! ^
        else inc A_i by 17 F6 y1 w$ L4 M5 i# |% j% E
    end+ k! @, j% Z0 _( A* v7 M
end
* \- a8 s4 Y+ Z# z& ^
, J: ]7 a5 j2 g- ibegin P_pick2 arriving
  v+ x$ ?9 G, u/ A% A    set A_i to 118 y  u( s  k: `* P! j
    move into Q_induct2
# @6 K* C2 }. N    move into pickaisle.induct2
, o% x4 }( c1 g! e- B; W    while A_i<=30 do begin
7 b$ R( U) N$ ?$ p, t, F        travel to pickaisle.con(A_i)
, |% Q( b" Q) l( Y. I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( M5 d/ s9 D# [; F
        else wait for 10 sec
  [3 s# N5 s  |% E7 |' v$ D        if A_i=A_leave then send to die* [: Z' J, {( Y6 S$ a* v/ [* b
        else inc A_i by 1" P* D- g1 m& W9 a& x# @
    end
% C) L+ a. g# Nend3 J# R' D7 g% P, T$ [9 @
" h: x$ T0 J4 c. T! s4 B; e$ b
begin P_pick3 arriving) ?" K$ v1 Z# |" g9 j! Z2 A9 L$ G
    set A_i to 21
1 C  s% j2 c; a, L  X- c. ^6 _    move into Q_induct3* H1 o, Q8 E1 r4 I/ j, S
    move into pickaisle.induct3
8 J3 {" t+ G2 X    while A_i<=30 do begin
$ B4 z) D3 R0 n" }        travel to pickaisle.con(A_i)5 y1 ], |. I4 H/ U9 v! n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. p2 K8 e# i7 A  |) d
        else wait for 10 sec: {; R% s4 e4 z
        if A_i=A_leave then send to die7 o# t0 L& v- l& K$ g
        else inc A_i by 14 v0 S0 V2 _: _  Y1 V5 t4 h
    end
9 z# f8 R6 U- i3 D, f; ]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 d4 i5 u$ j0 m+ ^8 i5 h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# G1 T+ }8 ?+ ?6 I" b# O) ?) T& r/ |* N# z/ N8 }6 W: e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- a4 h6 B6 ~1 @0 `6 Y6 ~3 F3 m  g. ?! M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* N  U: J4 ?# }% y, U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 ^8 V9 n! `; T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# m/ o' p( Y# a- y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- u" r9 u  Z" k# pbegin P_induction arriving
; f  s! r/ n( o0 h5 g, _    clone 1 load to P_pick(A_induct)! j# }8 W8 m; |. c! g9 M( ^9 y
end最大的系
' V5 g7 Y8 y& a. e
+ w( |/ b! |: zbegin P_pick arriving
; h) ?: L" P, ]7 k    set A_i to procindex * 10 + 1; p$ g7 U! G) n: h1 v2 P6 y! n
    move into Q_induct(procindex)
! x0 m! f9 O* E    move into pickaisle.induct(procindex)- \5 g( ^& P" x: l. x8 U1 l6 f: p
    /*check the type of pickaisle.induct(i), for your last problem.*/3 `/ d# W0 Q5 F5 Y! S0 w8 U

& u/ S9 t4 q! B8 S7 _4 h6 k3 e6 h* O    while A_i<=30 do begin
( `  X  K$ t& e8 C, m% u1 d5 t        travel to pickaisle.con(A_i)
/ A8 @/ F' e( ]) X) c+ y% v- S, m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 i/ l5 t6 ~! J8 C7 `9 D0 k2 Q
        else wait for 10 sec
4 t5 D4 r- c- M! ?# k5 U        if A_i=A_leave then send to die
9 M( G. S5 @* K# ?8 }$ O$ c# K        else inc A_i by 1. Y* a/ }) O1 S% W
    end7 o" L2 \  q6 g' K4 _
end1 f# N' q# ~: L9 |& ]) \. {; q) Q
6 Y; b# W% c% C) U, [" R
其中的procindex为整形,代表当前process的序号。
. X* L$ U1 ?8 N) I/ R- pstation和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-5-24 22:24 , Processed in 0.016416 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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